dplug.core.nogc

Various @nogc alternatives. This file includes parts of std.process, std.random, std.uuid.

Members

Aliases

CString
alias CString = CStringImpl!char
Undocumented in source.
CString16
alias CString16 = CStringImpl!wchar
Undocumented in source.
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

assumeNoGC
auto assumeNoGC(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.
browseNoGC
void browseNoGC(string url)
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 an interface object created with mallocEmplace.

destroyFree
void destroyFree(T* p)

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

destroyNoGC
void destroyNoGC(T x)
Undocumented in source. Be warned that the author may not have intended to support it.
destroyNoGC
void destroyNoGC(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.
destroyNoGC
void destroyNoGC(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.
ensureNotInGC
void ensureNotInGC(string resourceName)

Crash if the GC is running. Useful in destructors to avoid reliance GC resource release. However since this is not @nogc, this is not suitable in runtime-less D.

freeSlice
void freeSlice(const(T)[] slice)

Free a slice allocated with mallocSlice.

isCalledByGC
bool isCalledByGC()

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

mallocDup
T[] mallocDup(const(T)[] slice)
Undocumented in source. Be warned that the author may not have intended to support it.
mallocEmplace
auto mallocEmplace(Args args)

Allocates and construct a struct or class object.

mallocIDup
immutable(T)[] mallocIDup(const(T)[] slice)
Undocumented in source. Be warned that the author may not have intended to support it.
mallocSlice
T[] mallocSlice(size_t count)

Allocates a slice with malloc. This does not add GC roots so when using the runtime do not use such slice as traceable.

mallocSliceNoInit
T[] mallocSliceNoInit(size_t count)

Allocates a slice with malloc, but does not initialize the content. This does not add GC roots so when using the runtime do not use such slice as traceable.

mergeSort
void mergeSort(T[] inoutElements, T[] scratchBuffer, nogcComparisonFunction!T comparison)
Undocumented in source. Be warned that the author may not have intended to support it.
quicksort
void quicksort(T[] array, nogcComparisonFunction!T comparison)

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

stringNCopy
void stringNCopy(char* dest, size_t maxChars, const(char)[] source)
Undocumented in source. Be warned that the author may not have intended to support it.
unrecoverableError
void unrecoverableError()

To call for something that should never happen, but we still want to make a "best effort" at runtime even if it can be meaningless. MAYDO: change that name, it's not actually unrecoverable MAYDO: stop using that function

unsafeObjectCast
T unsafeObjectCast(Object obj)

A bit faster than a dynamic cast. This is to avoid TypeInfo look-up.

Structs

CStringImpl
struct CStringImpl(CharType)

Zero-terminated C string, to replace toStringz and toUTF16z

Meta