Re: Properties & GC (was Re: Cocoa et al as HCI usability problem)
Re: Properties & GC (was Re: Cocoa et al as HCI usability problem)
- Subject: Re: Properties & GC (was Re: Cocoa et al as HCI usability problem)
- From: "Sherm Pendley" <email@hidden>
- Date: Fri, 23 May 2008 05:11:07 -0400
On Fri, May 23, 2008 at 4:45 AM, Michael Ash <email@hidden> wrote:
> On Fri, May 23, 2008 at 4:30 PM, Sherm Pendley <email@hidden>
> wrote:
>
> > Does this sound similar? Objective-C obviously already has access
> limiters,
> > but disassociating the object and property storage would eliminate the
> last
> > remnants of the fragile base class problem. It would also allow
> categories
> > to add ivars, would it not?
>
> Categories could only add ivars if they were loaded at the same time
> as the main class, otherwise they could change the size of already
> instantiated objects which is Very Bad.
That's just the problem that inside-out objects would solve! With the ivars
stored separately from the isa pointer, adding an ivar would simply add
another ivar storage dictionary to the heap. Since inside-out objects are
nothing more than keys into the ivar storage dictionaries, adding another
dictionary doesn't change the size of any objects past, present, or future.
As far as I know even this is
> not currently allowed by the language, though.
It's not, because of the problem you describe - an object's isa pointer and
all its ivar storage is allocated in one contiguous block.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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