[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: has my bug report & fix been submitted (in NSProcessInfo.m)?

From: Gregory John Casamento
Subject: Re: has my bug report & fix been submitted (in NSProcessInfo.m)?
Date: Wed, 20 Jul 2005 06:10:04 -0700 (PDT)


--- Sheldon Gill <address@hidden> wrote:

> Gregory,
> > <snip>
> > 
> >>This isn't exactly true, as I understand it. The objc runtime sends an 
> >>"initialize" message to every Class object after its been created.
> > 
> > Yes, and class objects (not instances of classes) should only be created
> once
> > by the runtime.  
> Absolutely.
> > As detailed in the other reply to Lloyd, the runtime (see libobjc) in
> sendmsg.c
> > sets a flag on classes that have had initialize called and only calls
> > initialize on classes whose flag is set to false.
> Sure.
> >>Since it is a normal message it obeys the normal rules for method lookup. 
> >>Hence, the actual method called can be that of the super. Therefore it is 
> >>entirely possible for an "+initialize" method to be called multiple times.
> > 
> > I never said initialize isn't a normal method.  You can, indeed, explicitly
> > call it as many times as you like.  My point is that it will only be called
> > once by the *runtime* when a class is first used/loaded according to the
> Apple
> > docs and the code in the gcc 3.4.3 version of libobjc.
> And my point is that the *runtime* can call a particular +initialize 
> implementation more than once due to inheritance. If ClassA implements 
> +initialize and ClassB derives from ClassA without overriding it then that 
> specific implementation will be called *twice*.

This is correct.  Please see my previous message to Lloyd and the list.

> Apple docs, 'The Objective-C Language' page 50:
> "Note that since initialize is inherited, it may be called multiple times on 
> behalf of subclasses."
> Anyway, aren't we basically in agreement about all this?
Yes, if you read my previous message to Lloyd, you'll see I give almost the
same example as you do above with class A and class B.

> Regards,
> Sheldon


Gregory John Casamento 
-- CEO/President Open Logic Corp. (A MD Corp.)
## Maintainer of Gorm (IB Equiv.) for GNUstep.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]