[*] RequestHeapOfRegion should take a memory view
This commit is contained in:
parent
39ba32df3c
commit
8b64a97514
@ -436,7 +436,7 @@ namespace Aurora::Memory
|
||||
*/
|
||||
AUKN_SHARED_API(AllocHeap, Heap, AuUInt uLength);
|
||||
|
||||
AUKN_SHARED_API(RequestHeapOfRegion, Heap, void *pPtr, AuUInt uLength);
|
||||
AUKN_SHARED_API(RequestHeapOfRegion, Heap, const MemoryViewWrite &memory);
|
||||
|
||||
// AllocHeap but use mimalloc (or the default allocator) instead
|
||||
AUKN_SHARED_API(AllocHeapMimalloc, Heap, AuUInt uLength);
|
||||
|
@ -17,9 +17,9 @@ namespace Aurora::Memory
|
||||
}
|
||||
|
||||
#include "MemRef.hpp"
|
||||
#include "MemoryView.hpp"
|
||||
#include "HeapStats.hpp"
|
||||
#include "Heap.hpp"
|
||||
#include "MemoryView.hpp"
|
||||
|
||||
#include "Cache.hpp"
|
||||
#include "SwapLock.hpp"
|
||||
|
@ -395,15 +395,21 @@ namespace Aurora::Memory
|
||||
static_cast<InternalHeap *>(heap)->RequestTermination();
|
||||
}
|
||||
|
||||
AUKN_SYM Heap *RequestHeapOfRegionNew(void *ptr, AuUInt size)
|
||||
AUKN_SYM Heap *RequestHeapOfRegionNew(const MemoryViewWrite &memory)
|
||||
{
|
||||
if (!memory)
|
||||
{
|
||||
SysPushErrorArg();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto heap = _new InternalHeap();
|
||||
if (!heap)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!heap->Init(size, ptr))
|
||||
if (!heap->Init(memory.length, memory.ptr))
|
||||
{
|
||||
delete heap;
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user