PATCH: Add --enable-__cxa_atexit

Jakub Jelinek jakub@redhat.com
Tue Jun 4 03:39:00 GMT 2002


On Mon, Jun 03, 2002 at 09:55:39AM -0700, H . J . Lu wrote:
> It looks like my patch didn't go through. Here it is again.
> 
> 
> H.J.

> 2002-06-02  H.J. Lu  (hjl@gnu.org)
> 
> 	* configure.in: Add --enable-__cxa_atexit.
> 	* configure: Regenerated.
> 	* config.in: Likewise.
> 
> 	* defaults.h (DEFAULT_USE_CXA_ATEXIT): New. Defined to be 0 if
> 	not defined.
> 
> 2002-06-02  H.J. Lu  (hjl@gnu.org)
> 
> 	* decl2.c (flag_use_cxa_atexit): Set to DEFAULT_USE_CXA_ATEXIT.

Is this because of [basic.stat.term]/3?
It is pretty expensive for startup time, especially with current glibc
implementation which is not designed for lots of atexit registered handlers
(as compared to DT_FINI resp. DT_FINI_ARRAY). atexit time is
O(number_of_currently_registered_atexit_handlers), and even if it wasn't,
it is pthread_lock + malloc + pthread_unlock + some data moving around
as opposed to doing nothing at constructor time. The destruction times
will be equal I think.

	Jakub



More information about the Gcc-patches mailing list