Update MemoryManagement.cpp
Add newline and fix title case and spacing
This commit is contained in:
parent
10d8fe0acb
commit
7d24276bb2
|
@ -66,7 +66,7 @@ void* AllocateAddressSpace(size_t size, void * base_address)
|
||||||
bool FreeAddressSpace(void* addr, size_t size)
|
bool FreeAddressSpace(void* addr, size_t size)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
size = 0; //unused
|
size = 0; // Unused
|
||||||
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
||||||
#else
|
#else
|
||||||
msync(addr, size, MS_SYNC);
|
msync(addr, size, MS_SYNC);
|
||||||
|
@ -96,7 +96,7 @@ bool DecommitMemory(void* addr, size_t size)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return VirtualFree((void*)addr, size, MEM_DECOMMIT) != 0;
|
return VirtualFree((void*)addr, size, MEM_DECOMMIT) != 0;
|
||||||
#else
|
#else
|
||||||
// instead of unmapping the address, we're just gonna trick
|
// Instead of unmapping the address, we're just gonna trick
|
||||||
// the TLB to mark this as a new mapped area which, due to
|
// the TLB to mark this as a new mapped area which, due to
|
||||||
// demand paging, will not be committed until used.
|
// demand paging, will not be committed until used.
|
||||||
|
|
||||||
|
@ -129,4 +129,4 @@ bool ProtectMemory(void* addr, size_t size, MEM_PROTECTION memProtection, MEM_PR
|
||||||
#else
|
#else
|
||||||
return mprotect(addr, size, OsMemProtection) == 0;
|
return mprotect(addr, size, OsMemProtection) == 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue