| Index: src/platform-win32.cc
|
| diff --git a/src/platform-win32.cc b/src/platform-win32.cc
|
| index b5a85f6689fadbe961efff0ca30d62dbfdd6d896..1eb83432236c632e10dab1052d40ea5869380f2d 100644
|
| --- a/src/platform-win32.cc
|
| +++ b/src/platform-win32.cc
|
| @@ -1416,6 +1416,33 @@ bool VirtualMemory::Uncommit(void* address, size_t size) {
|
| }
|
|
|
|
|
| +void* VirtualMemory::ReserveRegion(size_t size) {
|
| + return VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
|
| +}
|
| +
|
| +
|
| +bool VirtualMemory::CommitRegion(void* base, size_t size, bool is_executable) {
|
| + int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
|
| + if (NULL == VirtualAlloc(base, size, MEM_COMMIT, prot)) {
|
| + return false;
|
| + }
|
| +
|
| + UpdateAllocatedSpaceLimits(base, static_cast<int>(size));
|
| + return true;
|
| +}
|
| +
|
| +
|
| +bool VirtualMemory::UncommitRegion(void* base, size_t size) {
|
| + return VirtualFree(base, size, MEM_DECOMMIT) != false;
|
| +}
|
| +
|
| +
|
| +bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
|
| + return VirtualFree(base, size, MEM_DECOMMIT) != false;
|
| +}
|
| +
|
| +
|
| +
|
| // ----------------------------------------------------------------------------
|
| // Win32 thread support.
|
|
|
|
|