Add page allocation utility functions

This commit is contained in:
Damian Korczowski
2021-01-31 01:03:32 +01:00
parent 09be8994e9
commit 161e9bd373
5 changed files with 67 additions and 0 deletions

View File

@@ -51,6 +51,25 @@ void UnixPlatform::Free(void* ptr)
}
}
uint64 Win32Platform::GetDefaultPageSize()
{
return 16;
}
void* Win32Platform::AllocatePages(uint64 numPages, uint64 pageSize)
{
const uint64 numBytes = numPages * pageSize;
// Fallback to malloc
return malloc(numBytes);
}
void Win32Platform::FreePages(void* ptr)
{
// Fallback to free
free(ptr);
}
uint64 UnixPlatform::GetCurrentProcessId()
{
return getpid();