This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: PATCH: Disable dynamic allocation in atexit
- From: Mark Mitchell <mark at codesourcery dot com>
- To: "Schwarz, Konrad" <konrad dot schwarz at siemens dot com>
- Cc: Jeff Johnston <jjohnstn at redhat dot com>, newlib at sources dot redhat dot com
- Date: Tue, 21 Mar 2006 03:11:53 -0800
- Subject: Re: PATCH: Disable dynamic allocation in atexit
- References: <ECDC9C7BC7809340842C0E7FCF48C393EFCB9F@MCHP7IEA.ww002.siemens.net>
Schwarz, Konrad wrote:
> Why doesn't the compiler create calls to the destructors such that they
> get called automatically by the _fini function? What else is it there
> for?
The C++ standard requires the destructors be run in the opposite order
of initialization, interleaved with functions registered by the user
with atexit, and with destructors for function-local static objects.
There's no way to know the full order at link time.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713