Lumenarium/src_v2/platform/osx/lumenarium_osx_memory.cpp

31 lines
459 B
C++
Raw Normal View History

2022-03-22 18:13:06 +00:00
#define OSX_PAGE_SIZE KB(4) // TODO(PS): look this up
u64 platform_page_size() { return OSX_PAGE_SIZE; }
u8*
platform_mem_reserve(u64 size)
{
size_t size_cvt = (size_t)size_to_pages(size);
u8* result = (u8*)malloc(size);
return result;
}
u8*
platform_mem_commit(u8* base, u64 size)
{
return base;
}
bool
platform_mem_decommit(u8* base, u64 size)
{
return true;
}
bool
platform_mem_release(u8* base, u64 size)
{
free(base);
return true;
}