Re: copy and mutableCopy
Re: copy and mutableCopy
- Subject: Re: copy and mutableCopy
- From: ChanMaxthon <email@hidden>
- Date: Mon, 28 Apr 2014 01:06:23 +0800
I am not sure if Apple libraries COW but I know GNUstep uses COW on their NSData, NSDictionary and NSArray (and that and a different NSObject layout in their implementation of some classes are the reason why their libraries are faster than Apple's)
Simplest way is to copy NSData sand watch for calls to memcpy(3) and values of -bytes.
Sent from my iPhone
> On Apr 28, 2014, at 12:54 AM, Jens Alfke <email@hidden> wrote:
>
>
>> On Apr 27, 2014, at 4:06 AM, Maxthon Chan <email@hidden> wrote:
>>
>> Immutables copied are just retained and returned, and mutableCopied are COW.
>> Mutables copied generates COW.
>
> Hmm. Got any proof of the copy-on-write behavior? I’ve never heard of that being implemented in CF/Foundation classes.
>
>> That would be the fastest way implementing that.
>
> The “would” makes it sound as though you’re just speculating. If you are, please make that more clear.
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden