Differences From Artifact [bc6ced3df8]:
- File
src/OFString.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: 46045) [annotate] [blame] [check-ins using]
To Artifact [0e4634027e]:
- File src/OFString.m — part of check-in [3659c87c63] at 2012-09-06 19:13:50 on branch trunk — Add -[OFString initWithUTF8String:freeWhenDone:]. (user: js, size: 46395) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
292 293 294 295 296 297 298 299 300 301 302 303 304 305 | string = of_alloc_object([OFString_UTF8 class], UTF8StringLength + 1, 1, &storage); return (id)[string _initWithUTF8String: UTF8String length: UTF8StringLength storage: storage]; } - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding { if (encoding == OF_STRING_ENCODING_UTF_8) { id string; size_t length; | > > > > > > > > | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | string = of_alloc_object([OFString_UTF8 class], UTF8StringLength + 1, 1, &storage); return (id)[string _initWithUTF8String: UTF8String length: UTF8StringLength storage: storage]; } - initWithUTF8StringNoCopy: (const char*)UTF8String freeWhenDone: (BOOL)freeWhenDone { return (id)[[OFString_UTF8 alloc] initWithUTF8StringNoCopy: UTF8String freeWhenDone: freeWhenDone]; } - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding { if (encoding == OF_STRING_ENCODING_UTF_8) { id string; size_t length; |
︙ | ︙ | |||
673 674 675 676 677 678 679 680 681 682 683 684 685 686 | - initWithUTF8String: (const char*)UTF8String length: (size_t)UTF8StringLength { return [self initWithCString: UTF8String encoding: OF_STRING_ENCODING_UTF_8 length: UTF8StringLength]; } - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding { return [self initWithCString: cString encoding: encoding length: strlen(cString)]; | > > > > > > | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | - initWithUTF8String: (const char*)UTF8String length: (size_t)UTF8StringLength { return [self initWithCString: UTF8String encoding: OF_STRING_ENCODING_UTF_8 length: UTF8StringLength]; } - initWithUTF8StringNoCopy: (const char*)UTF8String freeWhenDone: (BOOL)freeWhenDone { return [self initWithUTF8String: UTF8String]; } - initWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding { return [self initWithCString: cString encoding: encoding length: strlen(cString)]; |
︙ | ︙ |