Skip navigation.
 
mlRe: @property problem
FROM : Jean-Daniel Dupas
DATE : Sun Feb 17 20:18:47 2008

Le 17 févr. 08 à 19:52, William Squires a écrit :

>
> On Feb 17, 2008, at 12:03 PM, Bill Bumgarner wrote:
>

>> On Feb 17, 2008, at 9:47 AM, William Squires wrote:

>>> On Feb 17, 2008, at 11:13 AM, Jim Correia wrote:

>>>> On Feb 17, 2008, at 11:59 AM, William Squires wrote:

>>>>> But it doesn't answer the question. Why even make the change in 
>>>>> the 64-bit runtime? This would seem to hide a source of bugs, by 
>>>>> taking the responsibility for providing storage away from the 
>>>>> programmer. Some storage is still necessary.

>>>> As it stands, you cannot add iVars to a base class in the 32-bit 
>>>> runtime without required that all subclasses be recompiled.

>>> ??? Why should the subclasses know anything about the base class 
>>> other than what the base class exposes in its API (from the POV of 
>>> whomever is writing the subclass code, if they follow proper OO 
>>> methodologies)? Only if I rewrite the subclass to specifically use 
>>> the new iVar should I need to recompile it.
>>> i.e. If I have a base class A

>>
>> It is an implementation detail.
>>
>> In the legacy -- 32 bit -- runtime, each subclass effectively tacks 
>> its instance variables onto the end of the superclass's instance 
>> variables as if it were all one big extensible C structure.  If the 
>> superclass adds an ivar, the offset of the ivars in said structure 
>> are thus incorrect and, unless you recompile, subclasses will read/
>> write from the wrong spot in memory and *boom*.
>>
>> The modern -- 64 bit -- runtime fixes this particular issue.
>>

> Okay, that explains it - weird... I wonder why ObjC did that?


That's not an obj-c issue. That's a runtime and compiler issue. If you 
want to know why the OS X runtime did that, you will have to go back 
to the NeXT's days.

Related mailsAuthorDate
ml@property problem Randall Meadows Feb 11, 22:14
mlRe: @property problem Melissa J. Turner Feb 11, 22:27
mlRe: @property problem Kyle Sluder Feb 11, 22:28
mlRe: @property problem Joshua Emmons Feb 11, 22:29
mlRe: @property problem Shawn Erickson Feb 11, 22:33
mlRe: @property problem j o a r Feb 11, 22:35
mlRe: @property problem Brian Christensen Feb 11, 22:38
mlRe: @property problem Randall Meadows Feb 11, 22:56
mlRe: @property problem Jens Alfke Feb 11, 23:11
mlRe: @property problem Kyle Sluder Feb 11, 23:32
mlRe: @property problem j o a r Feb 11, 23:53
mlRe: @property problem Adam P Jenkins Feb 12, 00:33
mlRe: @property problem Bill Bumgarner Feb 12, 00:46
mlRe: @property problem Wade Tregaskis Feb 12, 00:46
mlRe: @property problem Kyle Sluder Feb 12, 01:08
mlRe: @property problem Nick Zitzmann Feb 12, 01:58
mlRe: @property problem Jens Alfke Feb 12, 04:44
mlRe: @property problem Andrew Farmer Feb 12, 06:25
mlRe: @property problem Sean McBride Feb 12, 16:58
mlRe: @property problem j o a r Feb 12, 19:48
mlRe: @property problem Jens Alfke Feb 12, 20:14
mlRe: @property problem Wade Tregaskis Feb 12, 20:35
mlRe: @property problem William Squires Feb 16, 23:35
mlRe: @property problem Jean-Daniel Dupas Feb 17, 01:03
mlRe: @property problem William Squires Feb 17, 17:59
mlRe: @property problem glenn andreas Feb 17, 18:11
mlRe: @property problem Bill Bumgarner Feb 17, 18:11
mlRe: @property problem Jim Correia Feb 17, 18:13
mlRe: @property problem William Squires Feb 17, 18:47
mlRe: @property problem mmalc crawford Feb 17, 18:57
mlRe: @property problem Bill Bumgarner Feb 17, 19:03
mlRe: @property problem Jim Correia Feb 17, 19:04
mlRe: @property problem William Squires Feb 17, 19:52
mlRe: @property problem Jean-Daniel Dupas Feb 17, 20:18
mlRe: @property problem Sherm Pendley Feb 17, 21:03
mlRe: @property problem Bill Bumgarner Feb 17, 21:09
mlRe: @property problem Bill Bumgarner Feb 17, 21:17
mlRe: @property problem Jens Alfke Feb 18, 00:06