mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
V8: Don't use mprotect on Cygwin as virtual memory is managed directly via WinAPI calls.
Upstream fix: http://codereview.chromium.org/7549009
This commit is contained in:
1 parent
91ecfbcae8
commit
a962cca390
2 files changed
+8
No files matched your search
Vendored
+6
@@ -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);
|
||||
|
||||
Vendored
+2
@@ -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__
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user