mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Re-committing r76828 with the JIT memory manager changes now that the build
bots like the BumpPtrAllocator changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76902 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#ifndef LLVM_SYSTEM_MEMORY_H
|
||||
#define LLVM_SYSTEM_MEMORY_H
|
||||
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
@@ -26,11 +27,13 @@ namespace sys {
|
||||
/// @brief Memory block abstraction.
|
||||
class MemoryBlock {
|
||||
public:
|
||||
MemoryBlock() { }
|
||||
MemoryBlock(void *addr, size_t size) : Address(addr), Size(size) { }
|
||||
void *base() const { return Address; }
|
||||
unsigned size() const { return Size; }
|
||||
size_t size() const { return Size; }
|
||||
private:
|
||||
void *Address; ///< Address of first byte of memory area
|
||||
unsigned Size; ///< Size, in bytes of the memory area
|
||||
size_t Size; ///< Size, in bytes of the memory area
|
||||
friend class Memory;
|
||||
};
|
||||
|
||||
@@ -50,7 +53,7 @@ namespace sys {
|
||||
/// a null memory block and fills in *ErrMsg.
|
||||
///
|
||||
/// @brief Allocate Read/Write/Execute memory.
|
||||
static MemoryBlock AllocateRWX(unsigned NumBytes,
|
||||
static MemoryBlock AllocateRWX(size_t NumBytes,
|
||||
const MemoryBlock *NearBlock,
|
||||
std::string *ErrMsg = 0);
|
||||
|
||||
|
Reference in New Issue
Block a user