WIP: Functions: new local allocator for better memory reuse and performance #104630

Draft
Jacques Lucke wants to merge 44 commits from JacquesLucke/blender:local-allocator into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 2 additions and 0 deletions
Showing only changes of commit 90333ba8fc - Show all commits

View File

@ -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 {

View File

@ -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);