WIP: Functions: new local allocator for better memory reuse and performance #104630
|
@ -35,6 +35,7 @@ class LocalAllocator : NonCopyable, NonMovable {
|
|||
private:
|
||||
static constexpr int64_t s_alignment = 64;
|
||||
LocalAllocatorSet &owner_set_;
|
||||
AlignedBuffer<256, 64> initial_buffer_;
|
||||
LinearAllocator<> linear_allocator_;
|
||||
|
||||
struct Head {
|
||||
|
|
|
@ -13,6 +13,7 @@ LocalAllocatorSet::~LocalAllocatorSet() = default;
|
|||
|
||||
LocalAllocator::LocalAllocator(LocalAllocatorSet &owner_set) : owner_set_(owner_set)
|
||||
{
|
||||
linear_allocator_.provide_buffer(initial_buffer_);
|
||||
for (const int64_t i : IndexRange(small_buffer_pools_.size())) {
|
||||
LocalAllocatorPool &pool = small_buffer_pools_[i];
|
||||
pool.element_size = 8 * (i + 1);
|
||||
|
|
Loading…
Reference in New Issue