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.
assumeZeroTerminated
const(char)* assumeZeroTerminated(const(char)[] input)

Semantic function to check that a D string implicitely conveys a termination byte after the slice. (typically those comes from string literals or stringDup/stringIDup)

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.

debugLog
void debugLog(const(char)* message)
debugLogf
void debugLogf(const(char)* fmt, ...)

Outputs a debug string in either: - stdout on POSIX-like (visible in the command-line) - the Output Windows on Windows (visible withing Visual Studio or with dbgview.exe) Warning: no end-of-line added!

decodeBase64
ubyte[] decodeBase64(const(ubyte)[] data, char plusChar, char slashChar)
ubyte[] decodeBase64(const(char)[] data, char plusChar, char slashChar)

Decode a Base64 encoded value, returning a buffer to be freed with free(). null in case of error or zero size.

decodeBase64
void decodeBase64(const(ubyte)[] data, Vec!ubyte outBuffer, char plusChar, char slashChar, bool* err)

Decode a Base64 encoded value, appending the result onto a Vec!ubyte. Reusing the same Vec!ubyte allows you to avoid reallocations. Note: err must point to a bool and cannot be null. Ugly signature sorry.

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.
encodeBase64
ubyte[] encodeBase64(const(ubyte)[] buf, char plusChar, char slashChar)

Encode a ubyte array as Base64, returning the encoded value, which shall be destroyed with free.

encodeBase64
void encodeBase64(const(ubyte)[] input, Vec!ubyte outBuf, char plusChar, char slashChar)

Encode a ubyte array as Base64, placing the result onto an Vec!ubyte.

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

Frees a slice allocated with mallocSlice.

mallocDup
T[] mallocDup(const(T)[] slice)

Duplicates a slice with malloc. Equivalent to .dup Has to be cleaned-up with free(slice.ptr) or freeSlice(slice).

mallocIDup
immutable(T)[] mallocIDup(const(T)[] slice)

Duplicates a slice with malloc. Equivalent to .idup Has to be cleaned-up with free(slice.ptr) or freeSlice(slice).

mallocNew
auto mallocNew(Args args)

Allocates and construct a struct or class object.

mallocSlice
T[] mallocSlice(size_t count)

Allocates a slice with malloc.

mallocSliceNoInit
T[] mallocSliceNoInit(size_t count)

Allocates a slice with malloc, but does not initialize the content.

stringDup
char[] stringDup(const(char)* cstr)

Duplicates a zero-terminated string with malloc, return a char[] with zero-terminated byte. Has to be cleaned-up with free(s.ptr). Note: The zero-terminating byte is preserved. This allow to have a string which also can be converted to a C string with .ptr. However the zero byte is not included in slice length.

stringIDup
string stringIDup(const(char)* cstr)

Duplicates a zero-terminated string with malloc, return a string. with zero-terminated byte. Has to be cleaned-up with free(s.ptr).

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.
timSort
void timSort(T[] dst, Vec!T storeBuf, nogcComparisonFunction!T comparison)
Undocumented in source. Be warned that the author may not have intended to support it.
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