Struct MallocBuf
C malloc allocated array wrapper
struct MallocBuf(T);
Fields
| Name | Type | Description |
|---|---|---|
_allocated
|
T* | |
_allocatedSize
|
uint | |
_length
|
uint |
Properties
| Name | Type | Description |
|---|---|---|
length[get]
|
uint | get length |
length[set]
|
uint | set new length |
ptr[get]
|
T* | get pointer |
Methods
| Name | Description |
|---|---|
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 |