NN_REALLOCMSG(3compat)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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