Constructor

new (capacity:Int, ?factory:Void ‑> T)

Parameters:

`capacity`

the maximum capacity.

`factory`

if passed, preallocates the list by calling the factory function capacity times.

Variables

read onlycapacity:Int

@:value(0)read onlysize:Int = 0

Methods

free ():Void

Destroys this object by explicitly nullifying all elements for GC'ing used resources.

Improves GC efficiency/performance (optional).

inlineget (i:Int):T

Returns the element stored in the slot at index i.

inlinenext ():Int

Returns an index to the next free slot or -1 if all slots are occupied.

inlineput (i:Int):Void

"Returns" the element at index i. The slot is marked empty.

inlineset (i:Int, val:T):Void

Replaces the element stored in the slot at index i with val.