Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: src/base/platform/platform-posix.cc

Issue 768543002: [WIP] TrapHandler 2014/11/27. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 0b16dfdcc6bae14c943f2253e40674c2edb667d0..f3468e7587fb200f22d2afc3567e771e2ac42a8d 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -122,7 +122,7 @@ void OS::ProtectCode(void* address, const size_t size) {
// Create guard pages.
-void OS::Guard(void* address, const size_t size) {
+void OS::Guard(void* const address, size_t const size) {
#if V8_OS_CYGWIN
DWORD oldprotect;
VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect);
@@ -132,6 +132,17 @@ void OS::Guard(void* address, const size_t size) {
}
+// Remove guard pages.
+void OS::Unguard(void* const address, size_t const size) {
+#if V8_OS_CYGWIN
+ DWORD oldprotect;
+ VirtualProtect(address, size, PAGE_READWRITE, &oldprotect);
+#else
+ mprotect(address, size, PROT_READ | PROT_WRITE);
+#endif
+}
+
+
static LazyInstance<RandomNumberGenerator>::type
platform_random_number_generator = LAZY_INSTANCE_INITIALIZER;
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698