mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-13 05:49:21 -04:00
Revert "Isolate JKRHeap operator overloads" (#39)
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
#include <memory>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
// ============================================================================
|
||||
// Malloc-based allocator to bypass JKRHeap operator new/delete
|
||||
// Without this, side-table allocations call operator new -> JKRHeap::alloc
|
||||
@@ -47,7 +45,7 @@ template<typename T, typename... Args>
|
||||
std::unique_ptr<T, MallocDeleter<T>> make_malloc_unique(Args&&... args) {
|
||||
void* mem = std::malloc(sizeof(T));
|
||||
if (!mem) throw std::bad_alloc();
|
||||
T* obj = JKR_NEW_ARGS (mem) T(std::forward<Args>(args)...);
|
||||
T* obj = new (mem) T(std::forward<Args>(args)...);
|
||||
return std::unique_ptr<T, MallocDeleter<T>>(obj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user