Mission Base

Program Base Library Functions

int pblListEnsureCapacity

( PblList* list, int minCapacity )

Increases the capacity of this list instance, if necessary.

Documentation

Increases the capacity of this list instance, if necessary.

For array lists this method ensures that the list can hold at least the number of elements specified by the minimum capacity argument.

For linked lists this method does nothing, it justs returns the value of parameter minCapacity.

If the list is an array list and if the capacity is actually increased, this method has a memory and time complexity of O(N), with N being the new capacity of the list.

In all other cases this method has a time complexity of O(1).

Parameters:
list - The list to use
minCapacity - The desired minimum capacity
Returns:
int rc >= 0: OK, the list capacity is returned.
int rc < 0: An error, see pbl_errno:
PBL_ERROR_OUT_OF_MEMORY - Out of memory.

Alphabetic index



This page was generated with the help of DOC++.