Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -260,11 +260,11 @@ id *buffer; container = [[[OFObject alloc] init] autorelease]; count = [self count]; buffer = [container allocMemoryForNItems: [self count] - withSize: sizeof(*buffer)]; + ofSize: sizeof(*buffer)]; [self getObjects: buffer inRange: of_range(0, count)]; return buffer; @@ -344,11 +344,11 @@ if (![self isKindOfClass: [OFMutableArray class]]) return [OFArray_subarray arrayWithArray: self range: range]; buffer = [self allocMemoryForNItems: range.length - withSize: sizeof(*buffer)]; + ofSize: sizeof(*buffer)]; @try { [self getObjects: buffer inRange: range]; @@ -568,11 +568,11 @@ - (OFArray*)mappedArrayUsingBlock: (of_array_map_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryForNItems: count - withSize: sizeof(id)]; + ofSize: sizeof(id)]; @try { [self enumerateObjectsUsingBlock: ^ (id object, size_t index, BOOL *stop) { tmp[index] = block(object, index); @@ -590,11 +590,11 @@ - (OFArray*)filteredArrayUsingBlock: (of_array_filter_block_t)block { OFArray *ret; size_t count = [self count]; id *tmp = [self allocMemoryForNItems: count - withSize: sizeof(id)]; + ofSize: sizeof(id)]; @try { __block size_t i = 0; [self enumerateObjectsUsingBlock: ^ (id object, size_t index, Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -118,11 +118,11 @@ if (previousPool != nil) previousPool->nextPool = self; size = GROW_SIZE; objects = [self allocMemoryForNItems: GROW_SIZE - withSize: sizeof(id)]; + ofSize: sizeof(id)]; } @catch (id e) { [self release]; @throw e; } @@ -132,11 +132,11 @@ - (void)addObject: (id)object { if (count + 1 > size) { objects = [self resizeMemory: objects toNItems: size + GROW_SIZE - withSize: sizeof(id)]; + ofSize: sizeof(id)]; size += GROW_SIZE; } objects[count] = object; count++; Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -254,11 +254,11 @@ if (SIZE_MAX - count < 1) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + 1 - withSize: itemSize]; + ofSize: itemSize]; memcpy(data + count * itemSize, item, itemSize); count++; } @@ -277,11 +277,11 @@ if (nItems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + nItems - withSize: itemSize]; + ofSize: itemSize]; memcpy(data + count * itemSize, cArray, nItems * itemSize); count += nItems; } @@ -292,11 +292,11 @@ if (nItems > SIZE_MAX - count) @throw [OFOutOfRangeException newWithClass: isa]; data = [self resizeMemory: data toNItems: count + nItems - withSize: itemSize]; + ofSize: itemSize]; memmove(data + (index + nItems) * itemSize, data + index * itemSize, (count - index) * itemSize); memcpy(data + index * itemSize, cArray, nItems * itemSize); @@ -317,11 +317,11 @@ count -= nItems; @try { data = [self resizeMemory: data toNItems: count - withSize: itemSize]; + ofSize: itemSize]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e release]; } } @@ -337,11 +337,11 @@ count -= nItems; @try { data = [self resizeMemory: data toNItems: count - withSize: itemSize]; + ofSize: itemSize]; } @catch (OFOutOfMemoryException *e) { /* We don't really care, as we only made it smaller */ [e release]; } } @@ -350,11 +350,11 @@ { count--; @try { data = [self resizeMemory: data toNItems: count - withSize: itemSize]; + ofSize: itemSize]; } @catch (OFOutOfMemoryException *e) { /* We don't care, as we only made it smaller */ [e release]; } } @@ -529,11 +529,11 @@ newSize = ((count + nItems) * itemSize + lastPageByte) & ~lastPageByte; if (size != newSize) data = [self resizeMemory: data toNItems: newSize - withSize: itemSize]; + ofSize: itemSize]; memmove(data + (index + nItems) * itemSize, data + index * itemSize, (count - index) * itemSize); memcpy(data + index * itemSize, cArray, nItems * itemSize); Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -309,11 +309,11 @@ - (OFArray*)allKeys { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; id *cArray = [self allocMemoryForNItems: [self count] - withSize: sizeof(id)]; + ofSize: sizeof(id)]; OFArray *ret; OFEnumerator *enumerator; id key; size_t i = 0; @@ -339,11 +339,11 @@ - (OFArray*)allObjects { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; id *cArray = [self allocMemoryForNItems: [self count] - withSize: sizeof(id)]; + ofSize: sizeof(id)]; OFArray *ret; OFEnumerator *enumerator; id object; size_t i = 0; Index: src/OFDictionary_hashtable.m ================================================================== --- src/OFDictionary_hashtable.m +++ src/OFDictionary_hashtable.m @@ -78,11 +78,11 @@ selector: _cmd]; hashtable = (OFDictionary_hashtable*)dictionary; data = [self allocMemoryForNItems: hashtable->size - withSize: sizeof(*data)]; + ofSize: sizeof(*data)]; for (i = 0; i < hashtable->size; i++) data[i] = NULL; size = hashtable->size; @@ -136,11 +136,11 @@ if (newSize == 0) @throw [OFOutOfRangeException newWithClass: isa]; data = [self allocMemoryForNItems: newSize - withSize: sizeof(*data)]; + ofSize: sizeof(*data)]; for (i = 0; i < newSize; i++) data[i] = NULL; size = newSize; @@ -202,11 +202,11 @@ if (key == nil || object == nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; data = [self allocMemoryForNItems: 2 - withSize: sizeof(*data)]; + ofSize: sizeof(*data)]; size = 2; for (i = 0; i < size; i++) data[i] = NULL; @@ -247,11 +247,11 @@ if (newSize == 0) @throw [OFOutOfRangeException newWithClass: isa]; data = [self allocMemoryForNItems: newSize - withSize: sizeof(*data)]; + ofSize: sizeof(*data)]; for (j = 0; j < newSize; j++) data[j] = NULL; size = newSize; @@ -365,11 +365,11 @@ if (newSize == 0) @throw [OFOutOfRangeException newWithClass: isa]; data = [self allocMemoryForNItems: newSize - withSize: sizeof(*data)]; + ofSize: sizeof(*data)]; for (j = 0; j < newSize; j++) data[j] = NULL; size = newSize; @@ -616,11 +616,11 @@ - (OFArray*)allKeys { OFArray *ret; id *cArray = [self allocMemoryForNItems: count - withSize: sizeof(id)]; + ofSize: sizeof(id)]; size_t i, j; for (i = j = 0; i < size; i++) if (data[i] != NULL && data[i] != DELETED) cArray[j++] = data[i]->key; @@ -639,11 +639,11 @@ - (OFArray*)allObjects { OFArray *ret; id *cArray = [self allocMemoryForNItems: count - withSize: sizeof(id)]; + ofSize: sizeof(id)]; size_t i, j; for (i = j = 0; i < size; i++) if (data[i] != NULL && data[i] != DELETED) cArray[j++] = data[i]->object; Index: src/OFMutableArray_adjacent.m ================================================================== --- src/OFMutableArray_adjacent.m +++ src/OFMutableArray_adjacent.m @@ -152,11 +152,11 @@ if (nObjects > count) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: nObjects - withSize: sizeof(id)]; + ofSize: sizeof(id)]; memcpy(copy, cArray + (count - nObjects), nObjects * sizeof(id)); @try { [array removeNItems: nObjects]; mutations++; @@ -175,11 +175,11 @@ if (range.length > count - range.start) @throw [OFOutOfRangeException newWithClass: isa]; copy = [self allocMemoryForNItems: range.length - withSize: sizeof(id)]; + ofSize: sizeof(id)]; memcpy(copy, cArray + range.start, range.length * sizeof(id)); @try { [array removeNItems: range.length atIndex: range.start]; Index: src/OFMutableDictionary_hashtable.m ================================================================== --- src/OFMutableDictionary_hashtable.m +++ src/OFMutableDictionary_hashtable.m @@ -59,11 +59,11 @@ if (newSize == 0) @throw [OFOutOfRangeException newWithClass: isa]; newData = [self allocMemoryForNItems: newSize - withSize: sizeof(*newData)]; + ofSize: sizeof(*newData)]; for (i = 0; i < newSize; i++) newData[i] = NULL; for (i = 0; i < size; i++) { Index: src/OFMutableSet.m ================================================================== --- src/OFMutableSet.m +++ src/OFMutableSet.m @@ -148,11 +148,11 @@ OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; size_t count = [self count]; id *cArray; cArray = [self allocMemoryForNItems: count - withSize: sizeof(id)]; + ofSize: sizeof(id)]; @try { OFEnumerator *enumerator = [self objectEnumerator]; id object; size_t i = 0; Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -65,11 +65,11 @@ return; } unicodeLen = [self length]; unicodeString = [self allocMemoryForNItems: unicodeLen - withSize: sizeof(of_unichar_t)]; + ofSize: sizeof(of_unichar_t)]; i = j = 0; newCStringLength = 0; while (i < s->cStringLength) { Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -510,11 +510,11 @@ * \param nItems The number of items to allocate * \param size The size of each item to allocate * \return A pointer to the allocated memory */ - (void*)allocMemoryForNItems: (size_t)nItems - withSize: (size_t)size; + ofSize: (size_t)size; /** * \brief Resizes memory in the object's memory pool to the specified size. * * If the pointer is NULL, this is equivalent to allocating memory. @@ -539,11 +539,11 @@ * \param size The size of each item to resize to * \return A pointer to the resized memory chunk */ - (void*)resizeMemory: (void*)pointer toNItems: (size_t)nItems - withSize: (size_t)size; + ofSize: (size_t)size; /** * \brief Frees allocated memory and removes it from the object's memory pool. * * Does nothing if the pointer is NULL. Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -888,11 +888,11 @@ return pointer; } - (void*)allocMemoryForNItems: (size_t)nItems - withSize: (size_t)size + ofSize: (size_t)size { if (nItems == 0 || size == 0) return NULL; if (nItems > SIZE_MAX / size) @@ -933,15 +933,15 @@ pointer: pointer]; } - (void*)resizeMemory: (void*)pointer toNItems: (size_t)nItems - withSize: (size_t)size + ofSize: (size_t)size { if (pointer == NULL) return [self allocMemoryForNItems: nItems - withSize: size]; + ofSize: size]; if (nItems == 0 || size == 0) { [self freeMemory: pointer]; return NULL; } @@ -1121,11 +1121,11 @@ @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } + (void*)allocMemoryForNItems: (size_t)nItems - withSize: (size_t)size + ofSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } @@ -1136,11 +1136,11 @@ selector: _cmd]; } + (void*)resizeMemory: (void*)pointer toNItems: (size_t)nItems - withSize: (size_t)size + ofSize: (size_t)size { @throw [OFNotImplementedException newWithClass: self selector: _cmd]; } Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -440,11 +440,11 @@ OFDataArray *da; char *tmp; da = [OFDataArray dataArrayWithItemSize: itemSize]; tmp = [self allocMemoryForNItems: nItems - withSize: itemSize]; + ofSize: itemSize]; @try { [self readExactlyNBytes: nItems * itemSize intoBuffer: tmp]; @@ -937,11 +937,11 @@ fromBuffer: buffer]; #else uint16_t *tmp; tmp = [self allocMemoryForNItems: nInt16s - withSize: sizeof(uint16_t)]; + ofSize: sizeof(uint16_t)]; @try { size_t i; for (i = 0; i < nInt16s; i++) @@ -967,11 +967,11 @@ fromBuffer: buffer]; #else uint32_t *tmp; tmp = [self allocMemoryForNItems: nInt32s - withSize: sizeof(uint32_t)]; + ofSize: sizeof(uint32_t)]; @try { size_t i; for (i = 0; i < nInt32s; i++) @@ -997,11 +997,11 @@ fromBuffer: buffer]; #else uint64_t *tmp; tmp = [self allocMemoryForNItems: nInt64s - withSize: sizeof(uint64_t)]; + ofSize: sizeof(uint64_t)]; @try { size_t i; for (i = 0; i < nInt64s; i++) @@ -1027,11 +1027,11 @@ fromBuffer: buffer]; #else float *tmp; tmp = [self allocMemoryForNItems: nFloats - withSize: sizeof(float)]; + ofSize: sizeof(float)]; @try { size_t i; for (i = 0; i < nFloats; i++) @@ -1057,11 +1057,11 @@ fromBuffer: buffer]; #else double *tmp; tmp = [self allocMemoryForNItems: nDoubles - withSize: sizeof(double)]; + ofSize: sizeof(double)]; @try { size_t i; for (i = 0; i < nDoubles; i++) @@ -1127,11 +1127,11 @@ fromBuffer: buffer]; #else uint16_t *tmp; tmp = [self allocMemoryForNItems: nInt16s - withSize: sizeof(uint16_t)]; + ofSize: sizeof(uint16_t)]; @try { size_t i; for (i = 0; i < nInt16s; i++) @@ -1157,11 +1157,11 @@ fromBuffer: buffer]; #else uint32_t *tmp; tmp = [self allocMemoryForNItems: nInt32s - withSize: sizeof(uint32_t)]; + ofSize: sizeof(uint32_t)]; @try { size_t i; for (i = 0; i < nInt32s; i++) @@ -1187,11 +1187,11 @@ fromBuffer: buffer]; #else uint64_t *tmp; tmp = [self allocMemoryForNItems: nInt64s - withSize: sizeof(uint64_t)]; + ofSize: sizeof(uint64_t)]; @try { size_t i; for (i = 0; i < nInt64s; i++) @@ -1217,11 +1217,11 @@ fromBuffer: buffer]; #else float *tmp; tmp = [self allocMemoryForNItems: nFloats - withSize: sizeof(float)]; + ofSize: sizeof(float)]; @try { size_t i; for (i = 0; i < nFloats; i++) @@ -1247,11 +1247,11 @@ fromBuffer: buffer]; #else double *tmp; tmp = [self allocMemoryForNItems: nDoubles - withSize: sizeof(double)]; + ofSize: sizeof(double)]; @try { size_t i; for (i = 0; i < nDoubles; i++) Index: src/OFStreamObserver.m ================================================================== --- src/OFStreamObserver.m +++ src/OFStreamObserver.m @@ -127,11 +127,11 @@ newWithClass: isa]; #endif maxFD = cancelFD[0]; FDToStream = [self allocMemoryForNItems: maxFD + 1 - withSize: sizeof(OFStream*)]; + ofSize: sizeof(OFStream*)]; FDToStream[cancelFD[0]] = nil; } @catch (id e) { [self release]; @throw e; } @@ -283,11 +283,11 @@ if (fd > maxFD) { maxFD = fd; FDToStream = [self resizeMemory: FDToStream toNItems: maxFD + 1 - withSize: sizeof(OFStream*)]; + ofSize: sizeof(OFStream*)]; } FDToStream[fd] = queueCArray[i]; } Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -1888,11 +1888,11 @@ OFObject *object = [[[OFObject alloc] init] autorelease]; of_unichar_t *ret; size_t i, j; ret = [object allocMemoryForNItems: s->length + 2 - withSize: sizeof(of_unichar_t)]; + ofSize: sizeof(of_unichar_t)]; i = 0; j = 0; ret[j++] = 0xFEFF;