public native reserve(capacity as Int) as Void
Reserves internal storage for at least the requested number of elements. This avoids repeated reallocations when the final size is known in advance.
| Parameter | Description |
|---|---|
capacity | Expected minimum capacity. |
import klyn.collections values = ArrayListSync<Int>() values.reserve(1_000)