diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-11-16 19:11:45 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-11-16 19:11:45 +0300 |
commit | bee7a56687283cc3642d625357d8d2b1847b67a1 (patch) | |
tree | d4cb1318801ab19b845c5f433946b5122efeb472 /intern/guardedalloc | |
parent | 64003fa4b0b1699998a5b048d980eb775d547d8d (diff) |
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.
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 3 |
1 files changed, 2 insertions, 1 deletions
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; /** |