This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: static constructors/destructors and atexit


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]