From bee7a56687283cc3642d625357d8d2b1847b67a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 16 Nov 2021 17:11:45 +0100 Subject: 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. --- intern/guardedalloc/MEM_guardedalloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 713b1fac788..874abb88ff5 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -78,7 +78,8 @@ extern short (*MEM_testN)(void *vmemh); /** * 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; /** -- cgit v1.2.3