mirror of https://github.com/nodejs/node.git
V8: Don't use mprotect on Cygwin as virtual memory is managed directly via WinAPI calls.
Upstream fix: http://codereview.chromium.org/7549009pull/22966/head
parent
91ecfbcae8
commit
a962cca390
|
@ -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) {
|
void OS::Sleep(int milliseconds) {
|
||||||
unsigned int ms = static_cast<unsigned int>(milliseconds);
|
unsigned int ms = static_cast<unsigned int>(milliseconds);
|
||||||
usleep(1000 * ms);
|
usleep(1000 * ms);
|
||||||
|
|
|
@ -70,10 +70,12 @@ intptr_t OS::MaxVirtualMemory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __CYGWIN__
|
||||||
// Create guard pages.
|
// Create guard pages.
|
||||||
void OS::Guard(void* address, const size_t size) {
|
void OS::Guard(void* address, const size_t size) {
|
||||||
mprotect(address, size, PROT_NONE);
|
mprotect(address, size, PROT_NONE);
|
||||||
}
|
}
|
||||||
|
#endif // __CYGWIN__
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue