ScopedAllocator(ParentAllocator);ScopedAllocator delegates all allocation requests toParentAllocator.When destroyed, theScopedAllocator object automatically callsdeallocate for all memory allocated through its lifetime. (ThedeallocateAll function is also implemented with the same semantics.)ScopedAllocator go. Ifdeallocate is not needed, asimpler design combiningAllocatorList withRegion is recommended.import std.experimental.allocator.mallocator : Mallocator;import std.typecons : Ternary;ScopedAllocator!Mallocator alloc;writeln(alloc.empty);// Ternary.yesconst b = alloc.allocate(10);writeln(b.length);// 10writeln(alloc.empty);// Ternary.no
parent;parent is a property giving access to anAffixAllocator!ParentAllocator. Otherwise,parent is an alias forAffixAllocator!ParentAllocator.instance.alignment;goodAllocSize(size_tn);goodAllocSize (which accounts for the management overhead).allocate(size_tn);expand(ref void[]b, size_tdelta);reallocate(ref void[]b, size_ts);b to new sizes.owns(void[]b);owns(b).deallocate(void[]b);b.deallocateAll();empty() const;