static constructors/destructors and atexit

Steven Parkes parkes@sierravista.com
Sun Aug 9 14:03:00 GMT 1998


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.



More information about the Gcc mailing list