Skip to content

Commit

Permalink
Make PagedAllocator more compatible (esp., with HashMap)
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Dec 20, 2023
1 parent 1a1c06d commit 0567c5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/templates/paged_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PagedAllocator {
};

template <class... Args>
T *alloc(const Args &&...p_args) {
T *alloc(Args &&...p_args) {
if (thread_safe) {
spin_lock.lock();
}
Expand Down Expand Up @@ -99,6 +99,10 @@ class PagedAllocator {
}
}

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) {
Expand Down

0 comments on commit 0567c5d

Please sign in to comment.