@@ -239,11 +239,11 @@ } - (id const *)objects { size_t count = self.count; - id *buffer = of_malloc(count, sizeof(id)); + id *buffer = of_alloc(count, sizeof(id)); @try { [self getObjects: buffer inRange: of_range(0, count)]; @@ -381,11 +381,11 @@ if (![self isKindOfClass: [OFMutableArray class]]) return [OFSubarray arrayWithArray: self range: range]; - buffer = of_malloc(range.length, sizeof(*buffer)); + buffer = of_alloc(range.length, sizeof(*buffer)); @try { [self getObjects: buffer inRange: range]; ret = [OFArray arrayWithObjects: buffer @@ -856,11 +856,11 @@ #ifdef OF_HAVE_BLOCKS - (OFArray *)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; size_t count = self.count; - id *tmp = of_malloc(count, sizeof(id)); + id *tmp = of_alloc(count, sizeof(id)); @try { [self enumerateObjectsUsingBlock: ^ (id object, size_t idx, bool *stop) { tmp[idx] = block(object, idx); @@ -877,11 +877,11 @@ - (OFArray *)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; size_t count = self.count; - id *tmp = of_malloc(count, sizeof(id)); + id *tmp = of_alloc(count, sizeof(id)); @try { __block size_t i = 0; [self enumerateObjectsUsingBlock: ^ (id object, size_t idx,