diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-09-09 16:11:33 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-09-11 19:45:49 +0200 |
commit | 893f889d74b35bb7330c3ff3d0187042770a4490 (patch) | |
tree | b1435faf6380670ffc4a878d0cdcb29a0527f5a7 /core/os/memory.cpp | |
parent | 221884e6bc260c38f16422081b7d4efd49a71375 (diff) | |
download | redot-engine-893f889d74b35bb7330c3ff3d0187042770a4490.tar.gz |
[Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'core/os/memory.cpp')
-rw-r--r-- | core/os/memory.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/os/memory.cpp b/core/os/memory.cpp index 0d15b8dcf5..5f6216a5f1 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -74,7 +74,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) { void *mem = malloc(p_bytes + (prepad ? PAD_ALIGN : 0)); - ERR_FAIL_COND_V(!mem, nullptr); + ERR_FAIL_NULL_V(mem, nullptr); alloc_count.increment(); @@ -127,7 +127,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) { *s = p_bytes; mem = (uint8_t *)realloc(mem, p_bytes + PAD_ALIGN); - ERR_FAIL_COND_V(!mem, nullptr); + ERR_FAIL_NULL_V(mem, nullptr); s = (uint64_t *)mem; @@ -145,7 +145,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) { } void Memory::free_static(void *p_ptr, bool p_pad_align) { - ERR_FAIL_COND(p_ptr == nullptr); + ERR_FAIL_NULL(p_ptr); uint8_t *mem = (uint8_t *)p_ptr; |