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

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

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)
Patch Set: Cleanup Created 4 years, 2 months 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
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 3f4165de536c1f2047fc40dc248fd2158413598f..cbce33f61ab0302752cb9e38c7276b9619463078 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -129,6 +129,15 @@ void OS::Guard(void* address, const size_t size) {
#endif
}
+// Make a region of memory readable and writable.
+void OS::Unprotect(void* address, const size_t size) {
Michael Lippautz 2016/10/27 14:41:50 Maybe we should have OS::Protect as a dual functio
Eric Holk 2016/10/28 16:20:13 I think I'd probably do OS::Protect and take flags
+#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;

Powered by Google App Engine
This is Rietveld 408576698