diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-27 01:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-27 01:05:18 +0200 |
commit | eaaff9da3178fa515a0f051fda932c1dd04d53db (patch) | |
tree | 56173535c376e0324f89baccf4bc14b2580ead23 /core/pool_allocator.cpp | |
parent | d8c96461183f0dc3208c3d624674fa4544212ea5 (diff) | |
parent | 4e5310cc60dc17e5ef09e57115ca8236544679e4 (diff) | |
download | redot-engine-eaaff9da3178fa515a0f051fda932c1dd04d53db.tar.gz |
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
Diffstat (limited to 'core/pool_allocator.cpp')
-rw-r--r-- | core/pool_allocator.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 11a3be89bd..094352b5cc 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -206,8 +206,8 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) { if (!find_hole(&new_entry_indices_pos, size_to_alloc)) { mt_unlock(); - ERR_PRINT("memory can't be compacted further"); - return POOL_ALLOCATOR_INVALID_ID; + ERR_EXPLAIN("Memory can't be compacted further"); + ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID); } } @@ -217,7 +217,8 @@ PoolAllocator::ID PoolAllocator::alloc(int p_size) { if (!found_free_entry) { mt_unlock(); - ERR_FAIL_COND_V(!found_free_entry, POOL_ALLOCATOR_INVALID_ID); + ERR_EXPLAIN("No free entry found in PoolAllocator"); + ERR_FAIL_V(POOL_ALLOCATOR_INVALID_ID); } /* move all entry indices up, make room for this one */ |