summaryrefslogtreecommitdiff
path: root/deps/v8/src/base/platform/platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/base/platform/platform.h')
-rw-r--r--deps/v8/src/base/platform/platform.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/deps/v8/src/base/platform/platform.h b/deps/v8/src/base/platform/platform.h
index 9259ec8f78..55cff6bf64 100644
--- a/deps/v8/src/base/platform/platform.h
+++ b/deps/v8/src/base/platform/platform.h
@@ -158,6 +158,14 @@ class V8_BASE_EXPORT OS {
static PRINTF_FORMAT(1, 2) void PrintError(const char* format, ...);
static PRINTF_FORMAT(1, 0) void VPrintError(const char* format, va_list args);
+ // Memory access permissions. Only the modes currently used by V8 are listed
+ // here even though most systems support additional modes.
+ enum class MemoryPermission { kNoAccess, kReadWrite, kReadWriteExecute };
+
+ // Allocate/Free memory used by JS heap. Permissions are set according to the
+ // is_* flags. Returns the address of allocated memory, or NULL if failed.
+ static void* Allocate(const size_t requested, size_t* allocated,
+ MemoryPermission access);
// Allocate/Free memory used by JS heap. Pages are readable/writable, but
// they are not guaranteed to be executable unless 'executable' is true.
// Returns the address of allocated memory, or NULL if failed.
@@ -167,8 +175,8 @@ class V8_BASE_EXPORT OS {
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().
+ // but does not commit the memory. On POSIX systems it allocates memory as
+ // PROT_NONE, which also prevents it from being committed.
static void* AllocateGuarded(const size_t requested);
// This is the granularity at which the ProtectCode(...) call can set page