std.experimental.allocator.building_blocks.affix_allocator
struct AffixAllocator
Types 1
structAffixAllocator(Allocator, Prefix, Suffix = void)
Allocator that adds some extra data before (of type Prefix) and/or after (of type Suffix) any allocation made with its parent allocator. This is useful for uses where additional allocation-related information is needed, such as mutexes, reference counts, or walls for debugging memory corruption errors.
If Prefix is not void, Allocator must guarantee an alignment at least as large as Prefix.alignof.
Suffixes are slower to get at because of alignment rounding, so prefixes should be preferred. However, small prefixes blunt the alignment so if a large alignment with a small affix is needed, suffixes should be chosen.
The following methods are defined if Allocator defines them, and forward to it: deallocateAll, empty, owns.
Nested Templates
Impl()