diff options
Diffstat (limited to 'core/rid_owner.h')
-rw-r--r-- | core/rid_owner.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/core/rid_owner.h b/core/rid_owner.h index ad6996b9a7..77bbc3c83c 100644 --- a/core/rid_owner.h +++ b/core/rid_owner.h @@ -39,6 +39,7 @@ #include "core/safe_refcount.h" #include "core/set.h" #include "core/spin_lock.h" + #include <stdio.h> #include <typeinfo> @@ -68,15 +69,15 @@ public: template <class T, bool THREAD_SAFE = false> class RID_Alloc : public RID_AllocBase { - T **chunks; - uint32_t **free_list_chunks; - uint32_t **validator_chunks; + T **chunks = nullptr; + uint32_t **free_list_chunks = nullptr; + uint32_t **validator_chunks = nullptr; uint32_t elements_in_chunk; - uint32_t max_alloc; - uint32_t alloc_count; + uint32_t max_alloc = 0; + uint32_t alloc_count = 0; - const char *description; + const char *description = nullptr; SpinLock spin_lock; @@ -288,14 +289,7 @@ public: } RID_Alloc(uint32_t p_target_chunk_byte_size = 4096) { - chunks = nullptr; - free_list_chunks = nullptr; - validator_chunks = nullptr; - elements_in_chunk = sizeof(T) > p_target_chunk_byte_size ? 1 : (p_target_chunk_byte_size / sizeof(T)); - max_alloc = 0; - alloc_count = 0; - description = nullptr; } ~RID_Alloc() { @@ -412,4 +406,5 @@ public: RID_Owner(uint32_t p_target_chunk_byte_size = 4096) : alloc(p_target_chunk_byte_size) {} }; + #endif // RID_OWNER_H |