Skip to content

Commit

Permalink
MemMapper: Support alternative pagesizes
Browse files Browse the repository at this point in the history
  • Loading branch information
exverge-0 committed Aug 8, 2024
1 parent 4700a19 commit 3795fc0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/MemMapper/MemMapperUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 3795fc0

Please sign in to comment.