diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-15 09:44:09 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-15 09:44:09 +0000 |
commit | b9a99d459349148d3ac349066e143f17f185b43c (patch) | |
tree | 818d6d8a7add4c3c47fb3313588f1ffcf3798e81 /lib/ExecutionEngine/JIT | |
parent | 15cbb64eb4bb19e3b21e1c75af3096bced18eb2a (diff) | |
download | llvm-b9a99d459349148d3ac349066e143f17f185b43c.tar.gz llvm-b9a99d459349148d3ac349066e143f17f185b43c.tar.bz2 llvm-b9a99d459349148d3ac349066e143f17f185b43c.tar.xz |
[Allocator] Finally, finish nuking the redundant code that led me here
by removing the MallocSlabAllocator entirely and just using
MallocAllocator directly. This makes all off these allocators expose and
utilize the same core interface.
The only ugly part of this is that it exposes the fact that the JIT
allocator has no real handling of alignment, any more than the malloc
allocator does. =/ It would be nice to fix both of these to support
alignments, and then to leverage that in the BumpPtrAllocator to do less
over allocation in order to manually align pointers. But, that's another
patch for another day. This patch has no functional impact, it just
removes the somewhat meaningless wrapper around MallocAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index 1aadcce266..acd034b83e 100644 --- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -269,11 +269,11 @@ namespace { class DefaultJITMemoryManager; - class JITSlabAllocator { + class JITAllocator { DefaultJITMemoryManager &JMM; public: - JITSlabAllocator(DefaultJITMemoryManager &jmm) : JMM(jmm) { } - void *Allocate(size_t Size); + JITAllocator(DefaultJITMemoryManager &jmm) : JMM(jmm) { } + void *Allocate(size_t Size, size_t /*Alignment*/); void Deallocate(void *Slab, size_t Size); }; @@ -312,9 +312,9 @@ namespace { // Memory slabs allocated by the JIT. We refer to them as slabs so we don't // confuse them with the blocks of memory described above. std::vector<sys::MemoryBlock> CodeSlabs; - BumpPtrAllocatorImpl<JITSlabAllocator, DefaultSlabSize, + BumpPtrAllocatorImpl<JITAllocator, DefaultSlabSize, DefaultSizeThreshold> StubAllocator; - BumpPtrAllocatorImpl<JITSlabAllocator, DefaultSlabSize, + BumpPtrAllocatorImpl<JITAllocator, DefaultSlabSize, DefaultSizeThreshold> DataAllocator; // Circular list of free blocks. @@ -568,12 +568,12 @@ namespace { }; } -void *JITSlabAllocator::Allocate(size_t Size) { +void *JITAllocator::Allocate(size_t Size, size_t /*Alignment*/) { sys::MemoryBlock B = JMM.allocateNewSlab(Size); return B.base(); } -void JITSlabAllocator::Deallocate(void *Slab, size_t Size) { +void JITAllocator::Deallocate(void *Slab, size_t Size) { sys::MemoryBlock B(Slab, Size); sys::Memory::ReleaseRWX(B); } |