This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: static constructors/destructors and atexit
- To: Steven Parkes <parkes at sierravista dot com>
- Subject: Re: static constructors/destructors and atexit
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 10 Aug 1998 04:34:18 -0300
- Cc: egcs at cygnus dot com
- References: <199808092103.OAA20520@monterey.sierravista.com>
Steven Parkes <parkes@sierravista.com> writes:
> Since an atexit() call is made for each and every object with a
> destructor, that only allows 32 objects. We've hit this limit.
> Could the scheduling of these functions be done some other way?
No, because the Standard requires that functions registered with calls
to atexit() be executed before the destructors of global objects
constructed after the registration, and after the destructors of
global objects constructed before the registration. This was
discussed in the thread `p2736.C Is dtor order guaranteed?' in this
mailing list, please check the archives:
http://www.cygnus.com/ml/egcs/1998-Jul/0667.html
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil