summaryrefslogtreecommitdiffstats
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2023-09-20 07:32:14 -0500
committerGitHub <noreply@github.com>2023-09-20 07:32:14 -0500
commitb1fd1b65fd2bfbeac9704c2716ed20bcb08d7107 (patch)
treeb5ba76e9cc29d9c4459b0dceca43a524fab921d4 /src/core/memory.cpp
parent0d6de7a80e328c1969c9feabaf268008764c6812 (diff)
parent1e5767693e45f58e2ffdc45d4c4f26057e25a2d6 (diff)
downloadredot-cpp-b1fd1b65fd2bfbeac9704c2716ed20bcb08d7107.tar.gz
Merge pull request #1242 from AThousandShips/null_check
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 17b0696..80e71ec 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -42,7 +42,7 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
#endif
void *mem = internal::gdextension_interface_mem_alloc(p_bytes + (prepad ? PAD_ALIGN : 0));
- ERR_FAIL_COND_V(!mem, nullptr);
+ ERR_FAIL_NULL_V(mem, nullptr);
if (prepad) {
uint8_t *s8 = (uint8_t *)mem;
@@ -71,7 +71,7 @@ void *Memory::realloc_static(void *p_memory, size_t p_bytes, bool p_pad_align) {
if (prepad) {
mem -= PAD_ALIGN;
mem = (uint8_t *)internal::gdextension_interface_mem_realloc(mem, p_bytes + PAD_ALIGN);
- ERR_FAIL_COND_V(!mem, nullptr);
+ ERR_FAIL_NULL_V(mem, nullptr);
return mem + PAD_ALIGN;
} else {
return (uint8_t *)internal::gdextension_interface_mem_realloc(mem, p_bytes);