ae.utils.alloc

Undocumented in source.

Members

Classes

BufferExhaustedException
deprecated class BufferExhaustedException

Thrown when the buffer of an allocator is exhausted.

Functions

allocate
deprecated RefType!T allocate(A a)
Undocumented in source. Be warned that the author may not have intended to support it.
create
deprecated RefType!T create(A a, Args args)

Default "create" implementation.

destroy
deprecated void destroy(A a, R r)
Undocumented in source. Be warned that the author may not have intended to support it.
free
deprecated void free(A a, R r)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixin templates

AllocTypes
deprecated mixintemplate AllocTypes()

Creates T/R/V aliases from context, and checks ALLOCATOR_TYPE if appropriate.

AllocatorCommon
deprecated mixintemplate AllocatorCommon()

Common declarations for an allocator mixin

PointerBumpCommon
deprecated mixintemplate PointerBumpCommon()

Common code for pointer-bumping allocator implementations.

Structs

BufferAllocator
deprecated struct BufferAllocator(BASE_TYPE = ubyte)

Homogeneous allocator which uses a given buffer. Throws BufferExhaustedException if the buffer is exhausted.

DataAllocator
deprecated struct DataAllocator

Backend allocator using the Data type from ae.sys.data.

FreeListAllocator
deprecated struct FreeListAllocator(ALLOCATOR_TYPE, alias ALLOCATOR = heapAllocator)

Homogeneous linked list allocator. Supports O(1) deletion. Does not support bulk allocation.

GCRootAllocatorProxy
deprecated struct GCRootAllocatorProxy(alias ALLOCATOR)
Undocumented in source.
GrowingBufferAllocator
deprecated struct GrowingBufferAllocator(BASE_TYPE = void*, alias ALLOCATOR = heapAllocator)

Growing buffer bulk allocator. Allows reusing the same buffer, which is grown and retained as needed. Requires .resize support from underlying allocator. Smaller buffers are discarded (neither freed nor reused).

HeapAllocator
deprecated struct HeapAllocator

Backend allocator Allocates from D's managed heap directly.

HybridBufferAllocator
deprecated struct HybridBufferAllocator(size_t SIZE, BASE_TYPE = ubyte, alias ALLOCATOR = heapAllocator)

A bulk allocator which behaves like a StaticBufferAllocator initially, but once the static buffer is exhausted, it switches to a fallback bulk allocator. Needs to be manually initialized before use. ALLOCATOR is the fallback allocator.

InitializingAllocatorProxy
deprecated struct InitializingAllocatorProxy(string INIT_CODE, alias ALLOCATOR = heapAllocator)

Allocator proxy which injects custom code after object creation. Context of INIT_CODE: p - newly-allocated value.

PageAllocator
deprecated struct PageAllocator

Backend for direct OS page allocation.

RegionAllocator
deprecated struct RegionAllocator(BASE_TYPE = void*, size_t BLOCKSIZE = 1024, alias ALLOCATOR = heapAllocator)

Classic region. Compose over another allocator to allocate values in bulk (minimum of BLOCKSIZE). No deletion, but is slightly faster that FreeListAllocator. BASE_TYPE indicates the type used for upstream allocations. It is not possible to bulk-allocate types smaller than BASE_TYPE, or those the size of which is not divisible by BASE_TYPE's size. (This restriction allows for allocations of single BASE_TYPE-sized items to be a little faster.)

StatAllocatorProxy
deprecated struct StatAllocatorProxy(alias ALLOCATOR = heapAllocator)

Allocator proxy which keeps track how many allocations were made.

StaticBufferAllocator
deprecated struct StaticBufferAllocator(size_t SIZE, BASE_TYPE = ubyte)

Homogeneous allocator which uses a static buffer of a given size. Throws BufferExhaustedException if the buffer is exhausted. Needs to be manually initialized before use.

TrackingAllocatorProxy
deprecated struct TrackingAllocatorProxy(ALLOCATOR_TYPE, alias ALLOCATOR = heapAllocator)

Allocator proxy which keeps track of all allocations, and implements freeAll by discarding them all at once via the underlying allocator's freeMany.

WrapParts
deprecated struct WrapParts(T)

Instantiates a struct from a type containing a Data/Impl template pair.

Templates

FreeListNode
deprecated template FreeListNode(T)

The internal unit allocation type of FreeListAllocator. (Exposed to allow specializing underlying allocators on it.)

PartsWrapper
deprecated template PartsWrapper(alias T)

Creates a template which, when instantiated, forwards its arguments to T and uses WrapParts on the result.

mixAliasForward
deprecated template mixAliasForward(alias M, string name = __traits(identifier, M))

Generates code to create forwarding aliases to the given mixin/template member. Used as a replacement for "alias M this", which doesn't seem to work with mixins and templates.

Variables

heapAllocator
deprecated HeapAllocator heapAllocator;
Undocumented in source.

Meta