Re: Zeroing out instance variables
Re: Zeroing out instance variables
- Subject: Re: Zeroing out instance variables
- From: Kyle Sluder <email@hidden>
- Date: Sat, 17 Apr 2010 23:09:03 -0700
On Sat, Apr 17, 2010 at 8:29 PM, Ben Haller
<email@hidden> wrote:
> I don't think I'm crazy about this. There are many different subclasses,
> so each subclass would have its own corresponding struct, and every ivar
> access would go through an indirection; it sounds very confusing and messy.
> Not to say there might not be cases where it would be the correct design;
> but for my situation, I think I'm happier with my current design. Thanks
> for the suggestion, though!
Dirty little secret: every ivar access on 64-bit is already indirected
through the runtime. Otherwise the runtime couldn't support
non-fragile instance variables. :)
You could theoretically get better performance if your instance
variable were a pointer-to-struct. But if your way is sufficiently
performant, stick with it.
--Kyle Sluder
_______________________________________________
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