@@ -52,39 +52,10 @@ + (instancetype)alloc { OF_UNRECOGNIZED_SELECTOR } -- (void *)allocMemoryWithSize: (size_t)size -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)allocMemoryWithSize: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)resizeMemory: (void *)pointer - size: (size_t)size -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)resizeMemory: (void *)pointer - size: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void *)pointer -{ - OF_UNRECOGNIZED_SELECTOR -} - - (instancetype)retain { return self; } @@ -140,64 +111,31 @@ struct of_string_utf8_ivars *ivars; if ([self isMemberOfClass: [OFConstantUTF8String class]]) return; - if ((ivars = calloc(1, sizeof(*ivars))) == NULL) - @throw [OFOutOfMemoryException - exceptionWithRequestedSize: sizeof(*ivars)]; - + ivars = of_calloc(1, sizeof(*ivars)); ivars->cString = _cString; ivars->cStringLength = _cStringLength; switch (of_string_utf8_check(ivars->cString, - ivars->cStringLength, - &ivars->length)) { - case 1: - ivars->isUTF8 = true; - break; - case -1: - free(ivars); - @throw [OFInvalidEncodingException exception]; + ivars->cStringLength, &ivars->length)) { + case 1: + ivars->isUTF8 = true; + break; + case -1: + free(ivars); + @throw [OFInvalidEncodingException exception]; } _cString = (char *)ivars; object_setClass(self, [OFConstantUTF8String class]); } } + (instancetype)alloc { - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)allocMemoryWithSize: (size_t)size -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)allocMemoryWithSize: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)resizeMemory: (void *)pointer - size: (size_t)size -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void *)resizeMemory: (void *)pointer - size: (size_t)size - count: (size_t)count -{ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)freeMemory: (void *)pointer -{ OF_UNRECOGNIZED_SELECTOR } - (instancetype)retain {