Skip to content

Commit 0567c5d

Browse files
committed
Make PagedAllocator more compatible (esp., with HashMap)
1 parent 1a1c06d commit 0567c5d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/templates/paged_allocator.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class PagedAllocator {
5858
};
5959

6060
template <class... Args>
61-
T *alloc(const Args &&...p_args) {
61+
T *alloc(Args &&...p_args) {
6262
if (thread_safe) {
6363
spin_lock.lock();
6464
}
@@ -99,6 +99,10 @@ class PagedAllocator {
9999
}
100100
}
101101

102+
template <class... Args>
103+
T *new_allocation(Args &&...p_args) { return alloc(p_args...); }
104+
void delete_allocation(T *p_mem) { free(p_mem); }
105+
102106
private:
103107
void _reset(bool p_allow_unfreed) {
104108
if (!p_allow_unfreed || !std::is_trivially_destructible<T>::value) {

0 commit comments

Comments
 (0)