discuss-gnustep
[Top][All Lists]
Advanced

[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: Tue, 19 Jul 2005 18:39:17 -0700 (PDT)

Sheldon,

--- Sheldon Gill <sheldon@westnet.net.au> wrote:

> Gregory John Casamento wrote:
> > --- Andrew Ruder <aeruder@ksu.edu> wrote:
> >>Lloyd Dupont wrote:

<snip... code example>

> >>I don't think this could possibly be the correct fix.  This is just 
> >>duct-taping a fix over something else which is obviously broken... 
> >>Aren't + initialize methods only supposed to be called once?
> > 
> > That is correct.  The +initialize method should only be called once when
> the
> > class is loaded into the runtime.
> 
> 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.  

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.

> 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.

> 
> > I'm wondering if the runtime is being initialized properly when ObjC is
> called
> > from within .NET.  Isn't this what Lloyd is trying to do here?
> 
> I'm wondering the same thing. In this particular case, there isn't a subclass
> 
> of NSProcessInfo so the routine should be called just once. My testing hasn't
> 
> shown it to be called multiple times but then I'm not writing a C app with 
> LoadLibrary().
> 
> Lloyd, could you please provide a test case demonstrating the bug?

Yes, please do.

> Besides allowing us to investigate the cause, it will also help build a test 
> case for the regression set currently being developed.
> 
> 
> Regards,
> Sheldon
> 

Later, GJC

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]