[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,
--- Sheldon Gill <sheldon@westnet.net.au> 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
GJC
Gregory John Casamento
-- CEO/President Open Logic Corp. (A MD Corp.)
## Maintainer of Gorm (IB Equiv.) for GNUstep.
Re: has my bug report & fix been submitted (in NSProcessInfo.m)?, Lloyd Dupont, 2005/07/19
Re: has my bug report & fix been submitted (in NSProcessInfo.m)?, Richard Frith-Macdonald, 2005/07/20