@@ -57,10 +57,19 @@ * @param itemSize The size of a single element in the OFDataArray * @return A new autoreleased OFDataArray */ + (instancetype)dataArrayWithItemSize: (size_t)itemSize; +/*! + * @brief Creates a new OFDataArray with enough memory to hold the specified + * number of items which all have an item size of 1. + * + * @param capacity The initial capacity for the OFDataArray + * @return A new autoreleased OFDataArray + */ ++ (instancetype)dataArrayWithCapacity: (size_t)capacity; + /*! * @brief Creates a new OFDataArray with enough memory to hold the specified * number of items which all have the same specified size. * * @param itemSize The size of a single element in the OFDataArray @@ -113,10 +122,19 @@ * @param itemSize The size of a single element in the OFDataArray * @return An initialized OFDataArray */ - initWithItemSize: (size_t)itemSize; +/*! + * @brief Initializes an already allocated OFDataArray with enough memory to + * hold the specified number of items which all have an item size of 1. + * + * @param capacity The initial capacity for the OFDataArray + * @return An initialized OFDataArray + */ +- initWithCapacity: (size_t)capacity; + /*! * @brief Initializes an already allocated OFDataArray with enough memory to * hold the specified number of items which all have the same specified * size. *