diff --git a/deps/v8/src/platform-cygwin.cc b/deps/v8/src/platform-cygwin.cc index 5f283c35715..7cb4fd9709e 100644 --- a/deps/v8/src/platform-cygwin.cc +++ b/deps/v8/src/platform-cygwin.cc @@ -166,6 +166,12 @@ void OS::Free(void* address, const size_t size) { } +void OS::Guard(void* address, const size_t size) { + DWORD oldprotect; + VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); +} + + void OS::Sleep(int milliseconds) { unsigned int ms = static_cast(milliseconds); usleep(1000 * ms); diff --git a/deps/v8/src/platform-posix.cc b/deps/v8/src/platform-posix.cc index deb4b756189..9727efeee02 100644 --- a/deps/v8/src/platform-posix.cc +++ b/deps/v8/src/platform-posix.cc @@ -70,10 +70,12 @@ intptr_t OS::MaxVirtualMemory() { } +#ifndef __CYGWIN__ // Create guard pages. void OS::Guard(void* address, const size_t size) { mprotect(address, size, PROT_NONE); } +#endif // __CYGWIN__ // ----------------------------------------------------------------------------