Re: Zeroing out instance variables
Re: Zeroing out instance variables
- Subject: Re: Zeroing out instance variables
- From: "Paul Sanders" <email@hidden>
- Date: Sat, 17 Apr 2010 18:20:36 +0100
> I think my approach, with the excellent modifications suggested by
> Ken Thomases, makes me less nervous than the others proposed, since it
> touches only my own ivars and makes no assumptions about the nature of
> the rest of the bits in the object.
OK, best of luck. I think that 64-bit Obj-C's support for non-fragile instance variables might break the bitwise copy idea anyway, I'm not sure. Other than that I think it would be OK, especially if you knock out retain and release (i.e. override them to do nothing).
It might be wise to start zeroing you iVars at offset class_getInstanceSize([NSObject class]). That way you don't care how many 'hidden' iVars NSObject has or what size they are. I think, in fact, that was Ken's intention.
Paul Sanders.
_______________________________________________
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