gfm.core.memory

This module provide support for aligned memory.

Members

Aliases

nogcComparisonFunction
alias nogcComparisonFunction(T) = int delegate(in T a, in T b) nothrow @(nogc)

Must return -1 if a < b 0 if a == b 1 if a > b

Functions

alignedFree
void alignedFree(void* aligned)

Frees aligned memory allocated by alignedMalloc or alignedRealloc. Functionally equivalent to Visual C++ _aligned_free.

alignedMalloc
void* alignedMalloc(size_t size, size_t alignment)

Allocates an aligned memory chunk. Functionally equivalent to Visual C++ _aligned_malloc.

alignedRealloc
void* alignedRealloc(void* aligned, size_t size, size_t alignment)

Reallocates an aligned memory chunk allocated by alignedMalloc or alignedRealloc. Functionally equivalent to Visual C++ _aligned_realloc.

assumeNoGC
auto assumeNoGC(T t)
Undocumented in source. Be warned that the author may not have intended to support it.
assumeNothrow
auto assumeNothrow(T t)
Undocumented in source. Be warned that the author may not have intended to support it.
assumeNothrowNoGC
auto assumeNothrowNoGC(T t)
Undocumented in source. Be warned that the author may not have intended to support it.
debugBreak
void debugBreak()

Inserts a breakpoint instruction. useful to trigger the debugger.

destroyFree
void destroyFree(T p)

Destroys and frees a class object created with mallocEmplace.

destroyFree
void destroyFree(T* p)

Destroys and frees a non-class object created with mallocEmplace.

ensureNotInGC
void ensureNotInGC(string resourceName)

Crash if the GC is running. Useful in destructors to avoid reliance GC resource release.

isCalledByGC
bool isCalledByGC()

Destructors called by the GC enjoy a variety of limitations and relying on them is dangerous.

mallocEmplace
auto mallocEmplace(Args args)

Allocates and construct a struct or class object.

nextAlignedPointer
void* nextAlignedPointer(void* start, size_t alignment)
nogc_qsort
void nogc_qsort(T[] array, nogcComparisonFunction!T comparison)

@nogc quicksort From the excellent: http://codereview.stackexchange.com/a/77788

Meta