Skip navigation.
 
mlallocWithZone not working with Class Clusters?
FROM : Timothy Ritchey
DATE : Thu Nov 21 20:54:43 2002

I've been investigating the whole allocWithZone: issue now that
NSCreateZone is working on Jag, and have run across an interesting
issue. It seems as if the allocWithZone: method works for basic
classes, but not with class clusters, such as NSArray, NSString, etc. I
haven't fully explored this yet, but just tried it with a few classes.
Things like:


NSZone *z = NSCreateZone( ... );
NSString *s = [[NSString allocWithZone:z] initWithString:...];

if(NSZoneFromPointer(s) == z)
    NSLog(@"good");
else if(NSZoneFromPointer(s) == NSDefaultMallocZone)
    NSLog(@"bad");

Always return "bad" for NSArrays or NSStrings (mutable or not), but
work for things like NSData and NSHost. Is this by design, or are the
class cluster implementations not obeying the zone designation, or is
it not a class cluster issue at all?

Cheers,
tim
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlallocWithZone not working with Class Clusters? Timothy Ritchey Nov 21, 20:54
mlRe: allocWithZone not working with Class Clusters? Nat! Nov 22, 23:16
mlRe: allocWithZone not working with Class Clusters? Timothy Ritchey Nov 23, 02:16