[+] AuMemory::ReserveHeapMemory

This commit is contained in:
Reece Wilson 2023-10-26 17:05:44 +01:00
parent deaa18ab07
commit bf49eb5fdd
2 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,8 @@ namespace Aurora::Memory
// thread-local // thread-local
AUKN_SYM void SetMemoryLowNotification(MemoryLowNotification_f pFunc); AUKN_SYM void SetMemoryLowNotification(MemoryLowNotification_f pFunc);
AUKN_SYM void ReserveHeapMemory(AuUInt uHeapSize, bool bCommit = true);
AUKN_SYM AU_ALLOC void *_ZAlloc(Types::size_t length); AUKN_SYM AU_ALLOC void *_ZAlloc(Types::size_t length);
AUKN_SYM AU_ALLOC void *_ZAlloc(Types::size_t length, Types::size_t align); AUKN_SYM AU_ALLOC void *_ZAlloc(Types::size_t length, Types::size_t align);
AUKN_SYM AU_ALLOC void *_FAlloc(Types::size_t length); AUKN_SYM AU_ALLOC void *_FAlloc(Types::size_t length);
@ -43,7 +45,6 @@ namespace Aurora::Memory
AUKN_SYM AuUInt GetChunkSize(const void *head); AUKN_SYM AuUInt GetChunkSize(const void *head);
AUKN_SYM AuUInt GetPageSize(); AUKN_SYM AuUInt GetPageSize();
static void *__FAlloc(Types::size_t length, Types::size_t align) static void *__FAlloc(Types::size_t length, Types::size_t align)
{ {
return _FAlloc(length, align); return _FAlloc(length, align);

View File

@ -49,6 +49,11 @@ namespace Aurora::Memory
gLeakFinderFree = pFree; gLeakFinderFree = pFree;
} }
AUKN_SYM void ReserveHeapMemory(AuUInt uHeapSize, bool bCommit)
{
mi_reserve_os_memory(uHeapSize, bCommit, true);
}
AUKN_SYM AuUInt GetChunkSize(const void *head) AUKN_SYM AuUInt GetChunkSize(const void *head)
{ {
if (AuDebug::IsPointerReserveRange((void *)head)) if (AuDebug::IsPointerReserveRange((void *)head))