Farid Zaripov wrote:
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED] On Behalf Of Martin Sebor
Sent: Tuesday, August 28, 2007 7:11 PM
To: stdcxx-dev@incubator.apache.org
Subject: Re: [PATCH] STDCXX-77

I have one concern with the introduction of dynamic initialization and the pragma into the library. First, our (undocumented) design goal is to avoid requiring dynamic initialization in the library.
I.e., there should be no code in the library that runs at startup.
The rationale for it is efficiency and avoiding user code issues due to initialization dependencies. Since other libraries may use the same pragma, they will be subject to initialization dependencies that we try to avoid.

Unless there is a way to avoid the dynamic initialization or defer it until runtime (i.e., initialize the handler lazily)

  We need initialize the handler before first operator new() call
(or from first oprator new() call), but I have not see the possible way
for this.

I wonder if defining DllMain() and setting the handler there,
for DLLs only, would deal with the initialization dependency
issue, albeit at the cost of a (small) runtime hit.

But given what we said about it being fixed in MSVC 8 I don't
think even this is worth the trouble. Not to mention that the
solution wouldn't work for archive libraries.

Martin

Reply via email to