| Index: src/platform-cygwin.cc
|
| diff --git a/src/platform-cygwin.cc b/src/platform-cygwin.cc
|
| index 042b2e54dea4b7ac706991516dc85e94ad5bd2ae..418a05e226148bb4b28fedb627d8eb62d195b7f8 100644
|
| --- a/src/platform-cygwin.cc
|
| +++ b/src/platform-cygwin.cc
|
| @@ -319,15 +319,11 @@ int OS::StackWalk(Vector<OS::StackFrame> frames) {
|
| // This causes VirtualMemory::Commit to not always commit the memory region
|
| // specified.
|
|
|
| -bool VirtualMemory::IsReserved() {
|
| - return address_ != NULL;
|
| -}
|
| +VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
|
|
|
|
|
| -VirtualMemory::VirtualMemory(size_t size) {
|
| - address_ = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);
|
| - size_ = size;
|
| -}
|
| +VirtualMemory::VirtualMemory(size_t size)
|
| + : address_(ReserveRegion(size)), size_(size) { }
|
|
|
|
|
| VirtualMemory::~VirtualMemory() {
|
| @@ -337,6 +333,17 @@ VirtualMemory::~VirtualMemory() {
|
| }
|
|
|
|
|
| +bool VirtualMemory::IsReserved() {
|
| + return address_ != NULL;
|
| +}
|
| +
|
| +
|
| +void VirtualMemory::Reset() {
|
| + address_ = NULL;
|
| + size_ = 0;
|
| +}
|
| +
|
| +
|
| bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
|
| int prot = is_executable ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;
|
| if (NULL == VirtualAlloc(address, size, MEM_COMMIT, prot)) {
|
| @@ -365,6 +372,29 @@ bool VirtualMemory::Guard(void* address) {
|
| }
|
|
|
|
|
| +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) {
|
| + UNIMPLEMENTED();
|
| + return false;
|
| +}
|
| +
|
| +
|
| +bool VirtualMemory::UncommitRegion(void* base, size_t size) {
|
| + UNIMPLEMENTED();
|
| + return false;
|
| +}
|
| +
|
| +
|
| +bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
|
| + UNIMPLEMENTED();
|
| + return false;
|
| +}
|
| +
|
| +
|
| bool VirtualMemory::HasLazyCommits() {
|
| // TODO(alph): implement for the platform.
|
| return false;
|
|
|