On Nov 15, 2011, at 8:44 AM, Torsten Curdt <tcu...@vafer.org> wrote:

>> In four words: Fragile Base Class Problem.
>> 
>> The problem is that a subclass (in 32 bit OS X) needs to know the size of 
>> the superclass so it know how to lay out its ivars.  If there is no explicit 
>> ivars, there is no way for the compiler to know the size (since when it is 
>> compiling the subclass it doesn't see all the files that may potentially 
>> contain the parent's ivars).
> 
> Think of it like the compiler generates the ivars from the property
> definitions. So the ivar would be indeed explicit ivars - just not
> defined as such in the classic way.

Doesn't matter. The subclass still needs to know the size of its superclass so 
that it generate the proper ivar offsets. If the ivar declarations are not 
visible to the compiler, it cannot know this information.

The modern runtime sidesteps this issue by storing the offset of each ivar in a 
global variable and indirecting all ivar access through that.

--Kyle Sluder_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to