Cleanup: document that MEM_dupallocN is NULL-safe

Add comment explaining `MEM_dupallocN` is NULL-safe, in that it returns
NULL when it receives a NULL pointer. This is currently true for both
implementations of the function (`MEM_lockfree_dupallocN` and
`MEM_guarded_dupallocN`), and will be expected of other implementations
as well.

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2021-11-16 17:11:45 +01:00
parent 64003fa4b0
commit bee7a56687

@ -78,7 +78,8 @@ extern short (*MEM_testN)(void *vmemh);
/** /**
* Duplicates a block of memory, and returns a pointer to the * Duplicates a block of memory, and returns a pointer to the
* newly allocated block. */ * newly allocated block.
* NULL-safe; will return NULL when receiving a NULL pointer. */
extern void *(*MEM_dupallocN)(const void *vmemh) /* ATTR_MALLOC */ ATTR_WARN_UNUSED_RESULT; extern void *(*MEM_dupallocN)(const void *vmemh) /* ATTR_MALLOC */ ATTR_WARN_UNUSED_RESULT;
/** /**