std.collections.Deque.Reserve - nitrologic/monkey2 GitHub Wiki

std::std.collections.std.collections.Deque.Reserve

Method Reserve:Void( capacity:monkey:monkey.types.Int )

Reserves deque storage capacity.

The capacity of a deque is the number of values it can contain before memory needs to be reallocated to store more values.

If a deque's length equals its capacity, then the next Add, Insert or Push operation will need to allocate more memory to 'grow' the deque.

You don't normally need to worry about deque capacity, but it can be useful to use Reserve to preallocate deque storage if you know in advance how many values a deque is likely to contain, in order to prevent excessive memory allocation.

Parameters
capacity capacity The new capacity.