@@ -123,11 +123,11 @@ @try { if (itemSize == 0) @throw [OFInvalidArgumentException exception]; - _items = of_alloc(count, itemSize); + _items = OFAllocMemory(count, itemSize); _count = count; _itemSize = itemSize; _freeWhenDone = true; memcpy(_items, items, count * itemSize); @@ -187,19 +187,19 @@ # if ULLONG_MAX > SIZE_MAX if (size > SIZE_MAX) @throw [OFOutOfRangeException exception]; # endif - buffer = of_alloc((size_t)size, 1); + buffer = OFAllocMemory((size_t)size, 1); file = [[OFFile alloc] initWithPath: path mode: @"r"]; @try { [file readIntoBuffer: buffer exactLength: (size_t)size]; } @finally { [file release]; } } @catch (id e) { - free(buffer); + OFFreeMemory(buffer); [self release]; @throw e; } @@ -206,11 +206,11 @@ @try { self = [self initWithItemsNoCopy: buffer count: (size_t)size freeWhenDone: true]; } @catch (id e) { - free(buffer); + OFFreeMemory(buffer); @throw e; } return self; } @@ -236,11 +236,11 @@ _count = 0; _itemSize = 1; _freeWhenDone = true; pageSize = [OFSystemInfo pageSize]; - buffer = of_alloc(1, pageSize); + buffer = OFAllocMemory(1, pageSize); @try { while (!stream.atEndOfStream) { size_t length = [stream readIntoBuffer: buffer @@ -248,16 +248,17 @@ if (SIZE_MAX - _count < length) @throw [OFOutOfRangeException exception]; - _items = of_realloc(_items, _count + length, 1); + _items = OFResizeMemory(_items, + _count + length, 1); memcpy(_items + _count, buffer, length); _count += length; } } @finally { - free(buffer); + OFFreeMemory(buffer); } objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @@ -279,11 +280,11 @@ if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; - _items = of_alloc(count, 1); + _items = OFAllocMemory(count, 1); _count = count; _itemSize = 1; _freeWhenDone = true; cString = [string cStringWithEncoding: OFStringEncodingASCII]; @@ -372,11 +373,11 @@ } - (void)dealloc { if (_freeWhenDone) - free(_items); + OFFreeMemory(_items); [_parentData release]; [super dealloc]; }