MmapArray

A variable size array backed by mmap-allocated memory.

Behaves just like a native dynamic array, but all methods are @nogc.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Alias This

arr

Members

Functions

allocate
void allocate(size_t numElements, bool registerWithGC)

Initial allocation of the array memory.

free
void free()

Free all allocated memory and set length to 0.

reserve
void reserve(size_t numElements)

Pre-allocate enough memory for at least numElements to be appended to the array.

Properties

arr
inout(T[]) arr [@property getter]

Returns the array as a standard D slice.

capacity
size_t capacity [@property getter]

Returns the number of elements the array can grow to with no further allocations

closed
bool closed [@property getter]

Returns true if the array currently has no allocated memory.

length
size_t length [@property getter]
size_t length [@property setter]

Get/set the number of elements in the array.

Parameters

shrink

Determines whether the capacity of the array can be reduced by setting .length. Allocated memory can always be freed by calling free().

Meta