MemMapper: Support alternative pagesizes

This commit is contained in:
Exverge 2024-08-07 18:19:22 -04:00
parent 4700a19009
commit 3795fc07fd
No known key found for this signature in database
GPG key ID: 19AAFC0AC6A9B35A

View file

@ -42,6 +42,12 @@ namespace MemMapper
void* AllocateMemory(void* baseAddr, size_t size, PAGE_PERMISSION permissionFlags, bool fromReservation)
{
uint64 page_size = sysconf(_SC_PAGESIZE);
if ((uint64) baseAddr % page_size != 0)
{
baseAddr = (void*) ((uint64)baseAddr & ~(page_size - 1));
}
void* r;
if(fromReservation)
{