Skip to content

Commit

Permalink
fix linux?
Browse files Browse the repository at this point in the history
  • Loading branch information
Force67 committed Jul 19, 2024
1 parent c32b109 commit 211e22f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/allocator/virtual_memory_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ byte* VirtualMemoryReserve(void* address, mem_size size) {

byte* VirtualMemoryAllocate(void* address,
mem_size size,
PageProtectionFlags protection) {
PageProtectionFlags protection, const bool reserve) {
int prot = static_cast<int>(protection);
int flags = MAP_ANONYMOUS | MAP_PRIVATE;
if (address) {
flags |= MAP_FIXED;
}
if (reserve) {
flags |= MAP_NORESERVE; // Don't commit physical memory yet
}
return reinterpret_cast<byte*>(::mmap(address, size, prot, flags, -1, 0));
}

Expand Down

0 comments on commit 211e22f

Please sign in to comment.