NN_REALLOCMSG(3compat)
π NN_REALLOCMSG β nng reference manual (3compat) π
okay bestie, so this whole page lives in the NNG Reference Manual, section 3compat, and the star of the show is nn_reallocmsg β the glow-up-your-message function. β¨
πΈ NAME πΈ
nn_reallocmsg β reallocate a message (the compatible API version, iykyk)
π¦ SYNOPSIS π¦
#include <nanomsg/nn.h>
void *nn_reallocmsg(void *old, size_t size);
π DESCRIPTION π
So nn_reallocmsg() reallocates the message old, making it of size size. That's it, that's the vibe. π«
Note π«Ά This function is provided for API compatibility with legacy libnanomsg. Consider using the relevant modern API instead. (fr fr, it's giving "kept around for the old heads" energy β the modern API is right there waiting for you.)
On success, the contents of old are copied into the new message (truncating if appropriate, so don't come for me if your data gets a lil trim βοΈ), then old is deallocated, and a pointer to the new message payload is returned. iconic behavior honestly π
On failure, the old message is unchanged, and the value NULL is returned to the caller. no surprises, no chaos, we love a safe bail-out π
π₯ RETURN VALUES π₯
This function returns a pointer to message buffer space, or NULL on failure. that's the whole deal π
β ERRORS β
ENOMEMβ insufficient memory is available. your machine said "bestie i'm full" πEINVALβ an invalid size was specified. you asked for a size that isn't a real size, and the library is not about that life πETERMβ the library is shutting down. doors closed, lights off, nobody's home π
π SEE ALSO π
and that's the whole page, bestie! π this lil writeup is from the NNG Reference Manual, dated 2026-01-13, filed under NN_REALLOCMSG(3compat) β go forth and reallocate responsibly ππ§
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms