ensureCapacity
Ensures the dictionary has enough space to store the requested number of key/object pairs.
Declaration
virtual unsigned int ensureCapacity(
unsigned intnewCapacity);Parameters
- newCapacity:
The total number of key/object pairs the dictionary should be able to store.
Return Value
The new capacity of the dictionary, which may be different from the number requested (if smaller, reallocation of storage failed).
Overview
This function immediately resizes the dictionary, if necessary, to accommodate at least newCapacity key/object pairs. If newCapacity is not greater than the current capacity, or if an allocation error occurs, the original capacity is returned.
There is no way to reduce the capacity of an OSDictionary.
See Also
Miscellaneous
copyCollectionflushCollectionfreegetCapacitygetCapacityIncrementgetCountgetObjectgetObject(const OSString *)getObject(const OSSymbol *)initWithCapacityinitWithDictionaryinitWithObjects(const OSObject *, const OSString *, unsigned int, unsigned int)initWithObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)isEqualToisEqualTo(const OSDictionary *)isEqualTo(const OSDictionary *, const OSCollection *)mergeremoveObjectremoveObject(const OSString *)removeObject(const OSSymbol *)serializesetCapacityIncrementsetObjectsetObject(const OSString *, const OSMetaClassBase *)setObject(const OSSymbol *, const OSMetaClassBase *)withCapacitywithDictionarywithObjects(const OSObject *, const OSString *, unsigned int, unsigned int)withObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)