diff options
author | spacelord <[email protected]> | 2022-02-10 16:48:15 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:15 +0300 |
commit | a0c6d9ad0cf6b94c527a15da147eb24335281b6d (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/system/sys_alloc.h | |
parent | 16747e4f77455cca4932df21eb76f12cb0a97a5c (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system/sys_alloc.h')
-rw-r--r-- | util/system/sys_alloc.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/system/sys_alloc.h b/util/system/sys_alloc.h index 3f2ea951163..4221a28f8cc 100644 --- a/util/system/sys_alloc.h +++ b/util/system/sys_alloc.h @@ -19,20 +19,20 @@ inline void y_deallocate(void* p) { free(p); } -/** - * Behavior of realloc from C++99 to C++11 changed (http://www.cplusplus.com/reference/cstdlib/realloc/). - * - * Our implementation work as C++99: if new_sz == 0 free will be called on 'p' and nullptr returned. - */ +/** + * Behavior of realloc from C++99 to C++11 changed (http://www.cplusplus.com/reference/cstdlib/realloc/). + * + * Our implementation work as C++99: if new_sz == 0 free will be called on 'p' and nullptr returned. + */ inline void* y_reallocate(void* p, size_t new_sz) { - if (!new_sz) { - if (p) { - free(p); - } - - return nullptr; - } - + if (!new_sz) { + if (p) { + free(p); + } + + return nullptr; + } + void* r = realloc(p, new_sz); if (r == nullptr) { |