diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-12-20 12:01:39 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-12-20 12:05:27 +0100 |
commit | 0567c5df9f6fbd3f3237de38b36a8474a9a9b03b (patch) | |
tree | f81b6c2e977ae35034a59c15b8bc49c1a6c095c3 /core/templates | |
parent | 1a1c06dfebc470caa47dcc8b5c689f44f2bb82e2 (diff) | |
download | redot-engine-0567c5df9f6fbd3f3237de38b36a8474a9a9b03b.tar.gz |
Make PagedAllocator more compatible (esp., with HashMap)
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/paged_allocator.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/templates/paged_allocator.h b/core/templates/paged_allocator.h index 72425a8c3d..6f3f78d4d2 100644 --- a/core/templates/paged_allocator.h +++ b/core/templates/paged_allocator.h @@ -58,7 +58,7 @@ public: }; template <class... Args> - T *alloc(const Args &&...p_args) { + T *alloc(Args &&...p_args) { if (thread_safe) { spin_lock.lock(); } @@ -99,6 +99,10 @@ public: } } + template <class... Args> + T *new_allocation(Args &&...p_args) { return alloc(p_args...); } + void delete_allocation(T *p_mem) { free(p_mem); } + private: void _reset(bool p_allow_unfreed) { if (!p_allow_unfreed || !std::is_trivially_destructible<T>::value) { |