Struct MallocBuf

C malloc allocated array wrapper

struct MallocBuf(T);

Fields

NameTypeDescription
_allocated T*
_allocatedSize uint
_length uint

Properties

NameTypeDescription
length[get] uintget length
length[set] uintset new length
ptr[get] T*get pointer

Methods

NameDescription
clear () free allocated memory, set length to 0
fill (value) fill buffer with specified value
opDollar () array[$]
opIndex (index) const array[index];
opIndex (index) ref array[index];
opIndexAssign (index, value) array[index] = value;
opSlice (a, b) array[a..b]
opSlice () array[]
reserve (size) make sure buffer capacity is at least (size) items