Browse Source

V8: Don't use mprotect on Cygwin as virtual memory is managed directly via WinAPI calls.

Upstream fix: http://codereview.chromium.org/7549009
v0.7.4-release
Bert Belder 14 years ago
parent
commit
a962cca390
  1. 6
      deps/v8/src/platform-cygwin.cc
  2. 2
      deps/v8/src/platform-posix.cc

6
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<unsigned int>(milliseconds);
usleep(1000 * ms);

2
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__
// ----------------------------------------------------------------------------

Loading…
Cancel
Save