This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
static constructors/destructors and atexit
- To: egcs at cygnus dot com
- Subject: static constructors/destructors and atexit
- From: Steven Parkes <parkes at sierravista dot com>
- Date: Sun, 09 Aug 1998 14:03:11 -0700
The C++ front end is using atexit() to schedule destruction of static
local objects. However, a conforming atexit() implementation need only
handle 32 atexit() calls. 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? Otherwise,
should NEED_ATEXIT be defined for more ports?
We've made a local solution which essentially makes another atexit()-like
function (cdtoratexit()) which the static scheduler uses instead of the
real atexit(). cdtoratexit() calls atexit() once.