9#ifndef LLVM_SUPPORT_PERTHREADBUMPPTRALLOCATOR_H
10#define LLVM_SUPPORT_PERTHREADBUMPPTRALLOCATOR_H
26template <
typename AllocatorTy>
77 size_t TotalMemory = 0;
87 size_t BytesAllocated = 0;
92 return BytesAllocated;
104 errs() <<
"\n Allocator " << Idx <<
"\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the BumpPtrAllocator interface.
CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators.
PerThreadAllocator is used in conjunction with ThreadPoolExecutor to allow per-thread allocations.
std::unique_ptr< BumpPtrAllocator[]> Allocators
size_t getNumberOfAllocators() const
size_t getTotalMemory() const
Return total memory size used by all allocators.
void Deallocate(const void *Ptr, size_t Size, size_t Alignment)
Deallocate Ptr to Size bytes of memory allocated by this allocator.
size_t getBytesAllocated() const
Return allocated size by all allocators.
void Reset()
Reset state of allocators.
void * Allocate(size_t Size, size_t Alignment)
Allocate Size bytes of Alignment aligned memory.
void PrintStats() const
Print statistic for each allocator.
AllocatorTy & getThreadLocalAllocator()
Return allocator corresponding to the current thread.
void setRedZoneSize(size_t NewSize)
Set red zone for all allocators.
PerThreadAllocator< BumpPtrAllocator > PerThreadBumpPtrAllocator
unsigned getThreadIndex()
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Implement std::hash so that hash_code can be used in STL containers.