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

Unified Diff: src/base/platform/platform.h

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)
Patch Set: Merging with master Created 4 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 | « no previous file | src/base/platform/platform-linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/platform.h
diff --git a/src/base/platform/platform.h b/src/base/platform/platform.h
index 5d570e7048b6d1fc4b600cfd3f9e38ba397e4a18..374cddfc0c39c989adce633cda4c33ca07acdbb9 100644
--- a/src/base/platform/platform.h
+++ b/src/base/platform/platform.h
@@ -178,6 +178,11 @@ class V8_BASE_EXPORT OS {
bool is_executable);
static void Free(void* address, const size_t size);
+ // Allocates a region of memory that is inaccessible. On Windows this reserves
+ // but does not commit the memory. On Linux, it is equivalent to a call to
+ // Allocate() followed by Guard().
+ static void* AllocateGuarded(const size_t requested);
+
// This is the granularity at which the ProtectCode(...) call can set page
// permissions.
static intptr_t CommitPageSize();
@@ -188,6 +193,9 @@ class V8_BASE_EXPORT OS {
// Assign memory as a guard page so that access will cause an exception.
static void Guard(void* address, const size_t size);
+ // Make a region of memory readable and writable.
+ static void Unprotect(void* address, const size_t size);
+
// Generate a random address to be used for hinting mmap().
static void* GetRandomMmapAddr();
« no previous file with comments | « no previous file | src/base/platform/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698