Differences From Artifact [30423a3dc6]:
- File src/OFMutableString_UTF8.m — part of check-in [ff8b2a6c29] at 2012-07-16 22:44:23 on branch trunk — Don't require extra parentheses for OF_(UN)LIKELY. (user: js, size: 18345) [annotate] [blame] [check-ins using]
To Artifact [9ad6fdf9a8]:
- File
src/OFMutableString_UTF8.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 18335) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
20 21 22 23 24 25 26 | #include <stdlib.h> #include <string.h> #include <assert.h> #import "OFString.h" #import "OFString_UTF8.h" #import "OFMutableString_UTF8.h" | < > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include <stdlib.h> #include <string.h> #include <assert.h> #import "OFString.h" #import "OFString_UTF8.h" #import "OFMutableString_UTF8.h" #import "OFInvalidArgumentException.h" #import "OFInvalidEncodingException.h" #import "OFInvalidFormatException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" #import "of_asprintf.h" #import "unicode.h" @implementation OFMutableString_UTF8 + (void)initialize |
︙ | ︙ | |||
340 341 342 343 344 345 346 | withEncoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { if (encoding == OF_STRING_ENCODING_UTF_8) [self appendUTF8String: cString withLength: cStringLength]; else { | | | | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | withEncoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { if (encoding == OF_STRING_ENCODING_UTF_8) [self appendUTF8String: cString withLength: cStringLength]; else { void *pool = objc_autoreleasePoolPush(); [self appendString: [OFString stringWithCString: cString encoding: encoding length: cStringLength]]; objc_autoreleasePoolPop(pool); } } - (void)appendString: (OFString*)string { size_t UTF8StringLength; |
︙ | ︙ |