@@ -244,12 +244,12 @@ size_t count; id *buffer; container = [[[OFObject alloc] init] autorelease]; count = [self count]; - buffer = [container allocMemoryForNItems: [self count] - ofSize: sizeof(*buffer)]; + buffer = [container allocMemoryWithItemSize: sizeof(*buffer) + count: [self count]]; [self getObjects: buffer inRange: of_range(0, count)]; return buffer; @@ -333,12 +333,12 @@ if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_subarray arrayWithArray: self range: range]; - buffer = [self allocMemoryForNItems: range.length - ofSize: sizeof(*buffer)]; + buffer = [self allocMemoryWithItemSize: sizeof(*buffer) + count: range.length]; @try { [self getObjects: buffer inRange: range]; @@ -607,12 +607,12 @@ #ifdef OF_HAVE_BLOCKS - (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; size_t count = [self count]; - id *tmp = [self allocMemoryForNItems: count - ofSize: sizeof(id)]; + id *tmp = [self allocMemoryWithItemSize: sizeof(id) + count: count]; @try { [self enumerateObjectsUsingBlock: ^ (id object, size_t index, BOOL *stop) { tmp[index] = block(object, index); @@ -629,12 +629,12 @@ - (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; size_t count = [self count]; - id *tmp = [self allocMemoryForNItems: count - ofSize: sizeof(id)]; + id *tmp = [self allocMemoryWithItemSize: sizeof(id) + count: count]; @try { __block size_t i = 0; [self enumerateObjectsUsingBlock: ^ (id object, size_t index,