summaryrefslogtreecommitdiffstats
path: root/core/os/memory.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-09 16:11:33 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2023-09-11 19:45:49 +0200
commit893f889d74b35bb7330c3ff3d0187042770a4490 (patch)
treeb1435faf6380670ffc4a878d0cdcb29a0527f5a7 /core/os/memory.cpp
parent221884e6bc260c38f16422081b7d4efd49a71375 (diff)
downloadredot-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.cpp6
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;