QUESTION ON 2.95.2
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Fri Dec 31 23:54:00 GMT 1999
> The question is why gcc-2.95.2 would not allocate the gComponents
> when this is clearly declared as static.
Let me try to rephrase your question. Why does gcc not initialise
gComponents in the object file?
I assume that gComponents is indeed allocated - it is
zero-initialized. This happens to every object that needs a
construction procedure. Since the initial value of the array contains
the result of calls like
&nsScriptSecurityManager::GetCID()
the compiler cannot put-in a value at compile time; instead, run-time
initialization is needed.
I assume that RegisterSelf is called before this run-time
initialization occurs. There are many reasons why this could happen; I
don't know who is calling RegisterSelf and when.
Regards,
Martin
More information about the Gcc
mailing list