@@ -62,12 +62,11 @@ - init { self = [super init]; @try { - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cString = [self allocMemoryWithSize: 1]; s->cString[0] = '\0'; } @catch (id e) { [self release]; @@ -91,12 +90,11 @@ cStringLength >= 3 && !memcmp(cString, "\xEF\xBB\xBF", 3)) { cString += 3; cStringLength -= 3; } - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cString = [self allocMemoryWithSize: cStringLength + 1]; s->cStringLength = cStringLength; if (encoding == OF_STRING_ENCODING_UTF_8 || @@ -212,12 +210,11 @@ - initWithString: (OFString*)string { self = [super init]; @try { - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cStringLength = [string UTF8StringLength]; if ([string isKindOfClass: [OFString_UTF8 class]] || [string isKindOfClass: [OFMutableString_UTF8 class]]) @@ -255,12 +252,11 @@ string++; length--; } else if (byteOrder != OF_ENDIANESS_NATIVE) swap = YES; - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cStringLength = length; s->cString = [self allocMemoryWithSize: (length * 4) + 1]; s->length = length; @@ -338,12 +334,11 @@ string++; length--; } else if (byteOrder != OF_ENDIANESS_NATIVE) swap = YES; - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cStringLength = length; s->cString = [self allocMemoryWithSize: (length * 4) + 1]; s->length = length; @@ -441,12 +436,11 @@ if (format == nil) @throw [OFInvalidArgumentException exceptionWithClass: isa selector: _cmd]; - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; if ((cStringLength = of_vasprintf(&tmp, [format UTF8String], arguments)) == -1) @throw [OFInvalidFormatException exceptionWithClass: isa]; @@ -486,12 +480,11 @@ @try { OFString *component; size_t i, cStringLength; va_list argumentsCopy; - s = [self allocMemoryWithSize: sizeof(*s)]; - memset(s, 0, sizeof(*s)); + s = &s_store; s->cStringLength = [firstComponent UTF8StringLength]; if ([firstComponent isKindOfClass: [OFString_UTF8 class]] || [firstComponent isKindOfClass: