#include "src/libplatform/default-thread-isolated-allocator.h"
#if V8_HAS_PKU_JIT_WRITE_PROTECT
#if !V8_OS_LINUX
#error pkey support in this file is only implemented on Linux
#endif
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/utsname.h>
#include <unistd.h>
#endif
#if V8_HAS_PKU_JIT_WRITE_PROTECT
extern int pkey_alloc(unsigned int flags, unsigned int access_rights) V8_WEAK;
extern int pkey_free(int pkey) V8_WEAK;
namespace {
bool KernelHasPkruFix() { … }
int PkeyAlloc() { … }
int PkeyFree(int pkey) { … }
}
#endif
namespace v8::platform {
DefaultThreadIsolatedAllocator::DefaultThreadIsolatedAllocator()
#if V8_HAS_PKU_JIT_WRITE_PROTECT
: … { … }
DefaultThreadIsolatedAllocator::~DefaultThreadIsolatedAllocator() { … }
void* DefaultThreadIsolatedAllocator::Allocate(size_t size) { … }
void DefaultThreadIsolatedAllocator::Free(void* object) { … }
enum DefaultThreadIsolatedAllocator::Type DefaultThreadIsolatedAllocator::Type()
const { … }
int DefaultThreadIsolatedAllocator::Pkey() const { … }
bool DefaultThreadIsolatedAllocator::Valid() const { … }
}