mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
Make PagedAllocator more compatible (esp., with HashMap)
This commit is contained in:
parent
1a1c06dfeb
commit
0567c5df9f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user