|
LLVM
3.7.0
|
Memory Management. More...
#include <RuntimeDyld.h>
Public Member Functions | |
| virtual | ~MemoryManager () |
| virtual uint8_t * | allocateCodeSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName)=0 |
| Allocate a memory block of (at least) the given size suitable for executable code. More... | |
| virtual uint8_t * | allocateDataSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, StringRef SectionName, bool IsReadOnly)=0 |
| Allocate a memory block of (at least) the given size suitable for data. More... | |
| virtual void | reserveAllocationSpace (uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) |
Inform the memory manager about the total amount of memory required to allocate all sections to be loaded: CodeSize - the total size of all code sections DataSizeRO - the total size of all read-only data sections DataSizeRW - the total size of all read-write data sections. More... | |
| virtual bool | needsToReserveAllocationSpace () |
| Override to return true to enable the reserveAllocationSpace callback. More... | |
| virtual void | registerEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size)=0 |
| Register the EH frames with the runtime so that c++ exceptions work. More... | |
| virtual void | deregisterEHFrames (uint8_t *addr, uint64_t LoadAddr, size_t Size)=0 |
| virtual bool | finalizeMemory (std::string *ErrMsg=nullptr)=0 |
| This method is called when object loading is complete and section page permissions can be applied. More... | |
Memory Management.
Definition at line 88 of file RuntimeDyld.h.
|
inlinevirtual |
Definition at line 90 of file RuntimeDyld.h.
|
pure virtual |
Allocate a memory block of (at least) the given size suitable for executable code.
The SectionID is a unique identifier assigned by the RuntimeDyld instance, and optionally recorded by the memory manager to access a loaded section.
Implemented in llvm::SectionMemoryManager.
|
pure virtual |
Allocate a memory block of (at least) the given size suitable for data.
The SectionID is a unique identifier assigned by the JIT engine, and optionally recorded by the memory manager to access a loaded section.
Implemented in llvm::SectionMemoryManager.
Referenced by llvm::RuntimeDyldELF::finalizeLoad().
|
pure virtual |
Implemented in llvm::RTDyldMemoryManager.
Referenced by llvm::RuntimeDyldELF::deregisterEHFrames().
|
pure virtual |
This method is called when object loading is complete and section page permissions can be applied.
It is up to the memory manager implementation to decide whether or not to act on this method. The memory manager will typically allocate all sections as read-write and then apply specific permissions when this method is called. Code sections cannot be executed until this function has been called. In addition, any cache coherency operations needed to reliably use the memory are also performed.
Returns true if an error occurred, false otherwise.
Implemented in llvm::SectionMemoryManager.
|
inlinevirtual |
Override to return true to enable the reserveAllocationSpace callback.
Definition at line 121 of file RuntimeDyld.h.
|
pure virtual |
Register the EH frames with the runtime so that c++ exceptions work.
Addr parameter provides the local address of the EH frame section data, while LoadAddr provides the address of the data in the target address space. If the section has not been remapped (which will usually be the case for local execution) these two values will be the same.
Implemented in llvm::RTDyldMemoryManager.
Referenced by llvm::RuntimeDyldELF::registerEHFrames(), and llvm::RuntimeDyldCOFFX86_64::registerEHFrames().
|
inlinevirtual |
Inform the memory manager about the total amount of memory required to allocate all sections to be loaded: CodeSize - the total size of all code sections DataSizeRO - the total size of all read-only data sections DataSizeRW - the total size of all read-write data sections.
Note that by default the callback is disabled. To enable it redefine the method needsToReserveAllocationSpace to return true.
Definition at line 116 of file RuntimeDyld.h.
1.8.6