Another small optimisation for string creation ...

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38540 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2015-05-25 11:47:13 +00:00
parent 1c74bc231b
commit 1a8e11c350
2 changed files with 35 additions and 26 deletions

View file

@ -790,7 +790,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
* Set up infrastructure for placeholder strings.
*/
defaultPlaceholderString = (GSPlaceholderString*)
NSAllocateObject(GSPlaceholderStringClass, 0, NSDefaultMallocZone());
[GSPlaceholderStringClass allocWithZone: NSDefaultMallocZone()];
placeholderMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
NSNonRetainedObjectMapValueCallBacks, 0);
placeholderLock = [NSLock new];
@ -852,7 +852,7 @@ GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *locale)
* There is no placeholder object for this zone, so we
* create a new one and use that.
*/
obj = (id)NSAllocateObject(GSPlaceholderStringClass, 0, z);
obj = (id)[GSPlaceholderStringClass allocWithZone: z];
NSMapInsert(placeholderMap, (void*)z, (void*)obj);
}
[placeholderLock unlock];