@@ -608,24 +608,24 @@ PRE_IVAR->lastMem = preMem; return (char*)pointer + PRE_MEM_ALIGN; } -- (void*)allocMemoryWithItemSize: (size_t)itemSize - count: (size_t)count +- (void*)allocMemoryWithSize: (size_t)size + count: (size_t)count { - if (itemSize == 0 || count == 0) + if (size == 0 || count == 0) return NULL; - if (count > SIZE_MAX / itemSize) + if (count > SIZE_MAX / size) @throw [OFOutOfRangeException exceptionWithClass: isa]; - return [self allocMemoryWithSize: itemSize * count]; + return [self allocMemoryWithSize: size * count]; } - (void*)resizeMemory: (void*)pointer - toSize: (size_t)size + size: (size_t)size { void *new; struct pre_mem *preMem; if (pointer == NULL) @@ -660,27 +660,27 @@ return (char*)new + PRE_MEM_ALIGN; } - (void*)resizeMemory: (void*)pointer - itemSize: (size_t)itemSize + size: (size_t)size count: (size_t)count { if (pointer == NULL) - return [self allocMemoryWithItemSize: itemSize - count: count]; + return [self allocMemoryWithSize: size + count: count]; - if (itemSize == 0 || count == 0) { + if (size == 0 || count == 0) { [self freeMemory: pointer]; return NULL; } - if (count > SIZE_MAX / itemSize) + if (count > SIZE_MAX / size) @throw [OFOutOfRangeException exceptionWithClass: isa]; return [self resizeMemory: pointer - toSize: itemSize * count]; + size: size * count]; } - (void)freeMemory: (void*)pointer { if (pointer == NULL) @@ -837,26 +837,26 @@ { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } -+ (void*)allocMemoryWithItemSize: (size_t)itemSize - count: (size_t)count ++ (void*)allocMemoryWithSize: (size_t)size + count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer - toSize: (size_t)size + size: (size_t)size { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; } + (void*)resizeMemory: (void*)pointer - itemSize: (size_t)itemSize + size: (size_t)size count: (size_t)count { @throw [OFNotImplementedException exceptionWithClass: self selector: _cmd]; }