You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Copy a message onto the stack. The message persists. */
HvMessage *hv_msg_copy(const HvMessage *const m);
However, that's not "copied onto the stack". I'd suggest a new description:
Copy a message, allocating memory for it
The returned pointer MUST be deallocated by the caller via hv_msg_free().
The implementation (after one indirection), for reference:
// the message is serialised such that all symbol elements are placed in order at the end of the buffer
HvMessage *msg_copy(const HvMessage *m) {
const hv_uint32_t heapSize = msg_getSize(m);
char *r = (char *) hv_malloc(heapSize);
hv_assert(r != NULL);
msg_copyToBuffer(m, r, heapSize);
return (HvMessage *) r;
}
The text was updated successfully, but these errors were encountered:
The source and documentation say:
However, that's not "copied onto the stack". I'd suggest a new description:
The implementation (after one indirection), for reference:
The text was updated successfully, but these errors were encountered: