@@ -1027,11 +1027,11 @@ * to use -[initWithUTF8StringNoCopy:length:freeWhenDone:]. */ if (SIZE_MAX - (size_t)fileSize < 1) @throw [OFOutOfRangeException exception]; - tmp = of_malloc(1, (size_t)fileSize + 1); + tmp = of_malloc((size_t)fileSize + 1, 1); @try { file = [[OFFile alloc] initWithPath: path mode: @"r"]; [file readIntoBuffer: tmp @@ -2166,12 +2166,11 @@ bool hasPrefix; if ((prefixLength = prefix.length) > self.length) return false; - tmp = [self allocMemoryWithSize: sizeof(of_unichar_t) - count: prefixLength]; + tmp = of_malloc(prefixLength, sizeof(of_unichar_t)); @try { void *pool = objc_autoreleasePoolPush(); [self getCharacters: tmp inRange: of_range(0, prefixLength)]; @@ -2179,11 +2178,11 @@ hasPrefix = (memcmp(tmp, prefix.characters, prefixLength * sizeof(of_unichar_t)) == 0); objc_autoreleasePoolPop(pool); } @finally { - [self freeMemory: tmp]; + free(tmp); } return hasPrefix; } @@ -2197,12 +2196,11 @@ if ((suffixLength = suffix.length) > self.length) return false; length = self.length; - tmp = [self allocMemoryWithSize: sizeof(of_unichar_t) - count: suffixLength]; + tmp = of_malloc(suffixLength, sizeof(of_unichar_t)); @try { void *pool = objc_autoreleasePoolPush(); [self getCharacters: tmp inRange: of_range(length - suffixLength, @@ -2212,11 +2210,11 @@ hasSuffix = (memcmp(tmp, suffixCharacters, suffixLength * sizeof(of_unichar_t)) == 0); objc_autoreleasePoolPop(pool); } @finally { - [self freeMemory: tmp]; + free(tmp); } return hasSuffix; }