Skip to content

Commit

Permalink
Add SharedAllocatorList
Browse files Browse the repository at this point in the history
Co-authored-by: Elias Batek <[email protected]>
  • Loading branch information
jercaianu and 0xEAB committed Dec 26, 2024
1 parent 8973596 commit 4732be3
Show file tree
Hide file tree
Showing 2 changed files with 487 additions and 125 deletions.
13 changes: 13 additions & 0 deletions changelog/shared-allocator-list.dd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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));
---
Loading

0 comments on commit 4732be3

Please sign in to comment.