14 #ifndef LLVM_SUPPORT_MEMORY_H
15 #define LLVM_SUPPORT_MEMORY_H
17 #include "llvm/Support/DataTypes.h"
33 void *
base()
const {
return Address; }
34 size_t size()
const {
return Size; }
123 std::string *ErrMsg = 0);
static bool setRangeWritable(const void *Addr, size_t Size)
An abstraction for memory operations.
static void InvalidateInstructionCache(const void *Addr, size_t Len)
static bool ReleaseRWX(MemoryBlock &block, std::string *ErrMsg=0)
Release Read/Write/Execute memory.
static bool setExecutable(MemoryBlock &M, std::string *ErrMsg=0)
static error_code protectMappedMemory(const MemoryBlock &Block, unsigned Flags)
Set memory protection state.
MemoryBlock(void *addr, size_t size)
static bool setRangeExecutable(const void *Addr, size_t Size)
static MemoryBlock AllocateRWX(size_t NumBytes, const MemoryBlock *NearBlock, std::string *ErrMsg=0)
Allocate Read/Write/Execute memory.
Memory block abstraction.
static bool setWritable(MemoryBlock &M, std::string *ErrMsg=0)
static MemoryBlock allocateMappedMemory(size_t NumBytes, const MemoryBlock *const NearBlock, unsigned Flags, error_code &EC)
Allocate mapped memory.
static error_code releaseMappedMemory(MemoryBlock &Block)
Release mapped memory.