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.
1 changed files with 2 additions and 5 deletions
Showing only changes of commit 822a11dd6b - Show all commits

View File

@ -57,13 +57,10 @@ template<typename Allocator = GuardedAllocator> class LocalPool : NonCopyable, N
buffer = buffer_stack.stack.pop();
BLI_asan_unpoison(buffer, size);
}
else if (size <= 4096) {
else {
buffer = linear_allocator_.allocate(buffer_stack.element_size, buffer_stack.min_alignment);
}
else {
buffer = linear_allocator_.allocate(size_t(size),
std::max<size_t>(s_alignment, size_t(alignment)));
}
return buffer;
}