63 lines
1.4 KiB
C++
63 lines
1.4 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Memory.cpp
|
|
Date: 2021-6-12
|
|
Author: Reece
|
|
***/
|
|
#include <RuntimeInternal.hpp>
|
|
#include "Memory.hpp"
|
|
#include <mimalloc.h>
|
|
|
|
namespace Aurora::Memory
|
|
{
|
|
AUKN_SYM Types::size_t GetChunkSize(const void *head)
|
|
{
|
|
return mi_malloc_size(head);
|
|
}
|
|
|
|
AUKN_SYM void *_ZAlloc(Types::size_t length)
|
|
{
|
|
return mi_zalloc(length);
|
|
}
|
|
|
|
AUKN_SYM void *_ZAlloc(Types::size_t length, Types::size_t align)
|
|
{
|
|
return mi_zalloc_aligned(length, align);
|
|
}
|
|
|
|
AUKN_SYM void *_FAlloc(Types::size_t length)
|
|
{
|
|
return mi_malloc(length);
|
|
}
|
|
|
|
AUKN_SYM void *_FAlloc(Types::size_t length, Types::size_t align)
|
|
{
|
|
return mi_malloc_aligned(length, align);
|
|
}
|
|
|
|
AUKN_SYM void *_ZRealloc(void *buffer, Types::size_t length, Types::size_t align)
|
|
{
|
|
return mi_rezalloc_aligned(buffer, length, align);
|
|
}
|
|
|
|
AUKN_SYM void *_ZRealloc(void *buffer, Types::size_t length)
|
|
{
|
|
return mi_rezalloc(buffer, length);
|
|
}
|
|
|
|
AUKN_SYM void *_FRealloc(void *buffer, Types::size_t length, Types::size_t align)
|
|
{
|
|
return mi_realloc_aligned(buffer, length, align);
|
|
}
|
|
|
|
AUKN_SYM void *_FRealloc(void *buffer, Types::size_t length)
|
|
{
|
|
return mi_realloc(buffer, length);
|
|
}
|
|
|
|
AUKN_SYM void _Free(void *buffer)
|
|
{
|
|
mi_free(buffer);
|
|
}
|
|
} |