Skip to content

Commit

Permalink
Add SharedAllocatorList
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
jercaianu committed May 21, 2018
1 parent 4d27f76 commit 1d4dc09
Show file tree
Hide file tree
Showing 2 changed files with 382 additions and 130 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 1d4dc09

Please sign in to comment.