phobos/changelog/shared-allocator-list.dd
Elias Batek de2b97fd8d
Add SharedAllocatorList (#10594)
Co-authored-by: Alexandru Jercaianu <alex.jercaianu@gmail.com>
2024-12-27 11:40:08 +08:00

13 lines
620 B
Text

Added the `SharedAllocatorList`, as the thread-safe version of the regular `AllocatorList`.
The new $(REF SharedAllocatorList, std,experimental,allocator,building_blocks,allocator_list) has the same semantics as the regular `AllocatorList`.
Just as the regular `AllocatorList`, if the `BookkeepingAllocator` is `NullAllocator`, the `SharedAllocatorList` will switch to `ouroboros` mode,
allocationg memory for its own metadata.
---
SharedAllocatorList!((n) => SharedAscendingPageAllocator(max(n, numPages * pageSize)), NullAllocator) a;
auto b = a.allocate(100);
assert(b.length == 100);
assert(a.deallocate(b));
---