@@ -236,21 +236,21 @@ } - (id const *)objects { size_t count = self.count; - id *buffer = of_alloc(count, sizeof(id)); + id *buffer = OFAllocMemory(count, sizeof(id)); @try { [self getObjects: buffer inRange: OFRangeMake(0, count)]; return [[OFData dataWithItemsNoCopy: buffer count: count itemSize: sizeof(id) freeWhenDone: true] items]; } @catch (id e) { - free(buffer); + OFFreeMemory(buffer); @throw e; } } - (id)copy @@ -374,17 +374,17 @@ @throw [OFOutOfRangeException exception]; if (![self isKindOfClass: [OFMutableArray class]]) return [OFSubarray arrayWithArray: self range: range]; - buffer = of_alloc(range.length, sizeof(*buffer)); + buffer = OFAllocMemory(range.length, sizeof(*buffer)); @try { [self getObjects: buffer inRange: range]; ret = [OFArray arrayWithObjects: buffer count: range.length]; } @finally { - free(buffer); + OFFreeMemory(buffer); } return ret; } @@ -823,31 +823,31 @@ #ifdef OF_HAVE_BLOCKS - (OFArray *)mappedArrayUsingBlock: (OFArrayMapBlock)block { OFArray *ret; size_t count = self.count; - id *tmp = of_alloc(count, sizeof(id)); + id *tmp = OFAllocMemory(count, sizeof(id)); @try { [self enumerateObjectsUsingBlock: ^ (id object, size_t idx, bool *stop) { tmp[idx] = block(object, idx); }]; ret = [OFArray arrayWithObjects: tmp count: count]; } @finally { - free(tmp); + OFFreeMemory(tmp); } return ret; } - (OFArray *)filteredArrayUsingBlock: (OFArrayFilterBlock)block { OFArray *ret; size_t count = self.count; - id *tmp = of_alloc(count, sizeof(id)); + id *tmp = OFAllocMemory(count, sizeof(id)); @try { __block size_t i = 0; [self enumerateObjectsUsingBlock: ^ (id object, size_t idx, @@ -856,11 +856,11 @@ tmp[i++] = object; }]; ret = [OFArray arrayWithObjects: tmp count: i]; } @finally { - free(tmp); + OFFreeMemory(tmp); } return ret; }