diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-03-24 13:55:44 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-03-24 13:55:44 -0700 |
| commit | 7504183730d37b362ab4cb78e926d7bd90f2fd2c (patch) | |
| tree | 27e6c5e6b42fa3b9b9241f980e723b59b4258e2f /docs/reference/src/api | |
| parent | abb4dcaf84b4224788c1d343fe557079e053ee5b (diff) | |
| download | nng-7504183730d37b362ab4cb78e926d7bd90f2fd2c.tar.gz nng-7504183730d37b362ab4cb78e926d7bd90f2fd2c.tar.bz2 nng-7504183730d37b362ab4cb78e926d7bd90f2fd2c.zip | |
more doc updates
Diffstat (limited to 'docs/reference/src/api')
| -rw-r--r-- | docs/reference/src/api/nng_free.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/reference/src/api/nng_free.md b/docs/reference/src/api/nng_free.md new file mode 100644 index 00000000..cc1d3308 --- /dev/null +++ b/docs/reference/src/api/nng_free.md @@ -0,0 +1,35 @@ +# nng_free() + +## NAME + +nng_free --- free memory + +## SYNOPSIS + +```c +#include <nng/nng.h> + +void nng_free(void *ptr, size_t size); +``` + +## DESCRIPTION + +The `nng_free()` function deallocates a memory region of size _size_, +that was previously allocated by [`nng_alloc()`](nng_alloc.md) or +[`nng_recv()`](nng_recv.md) with the `NNG_FLAG_ALLOC` flag. + +> [!IMPORTANT] +> It is very important that _size_ match the allocation size +> used to allocate the memory. + +> [!IMPORTANT] +> Do not attempt to use this function to deallocate memory +> obtained by a call to the system `malloc()` or `calloc()` functions, +> or the C++ `new` operator. +> Doing so may result in unpredictable +> behavior, including corruption of application memory. + +## SEE ALSO + +[nng_alloc()](nng_alloc.md), +[nng_recv()](nng_free.md) |
