Constructs a region backed by a user-provided store.
Alignment offered.
Allocates n bytes of memory aligned at alignment a.
Allocates n bytes of memory. The allocation is served by atomically incrementing a pointer which keeps track of the current used space.
Deallocates b. This works only if b was obtained as the last call to allocate; otherwise (i.e. another allocation has occurred since) it does nothing.
Deallocates all memory allocated by this region, which can be subsequently reused for new allocations.
Returns Ternary.yes if no memory has been allocated in this region, Ternary.no otherwise. (Never returns Ternary.unknown.)
Rounds the given size to a multiple of the alignment
Queries whether b has been allocated with this region.
A SharedBorrowedRegion allocates directly from a user-provided block of memory.
Unlike a SharedRegion, a SharedBorrowedRegion does not own the memory it allocates from and will not deallocate that memory upon destruction. Instead, it is the user's responsibility to ensure that the memory is properly disposed of.
In all other respects, a SharedBorrowedRegion behaves exactly like a SharedRegion.