This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: PATCH: Disable dynamic allocation in atexit
- From: "Schwarz, Konrad" <konrad dot schwarz at siemens dot com>
- To: "Mark Mitchell" <mark at codesourcery dot com>, "Jeff Johnston" <jjohnstn at redhat dot com>
- Cc: <newlib at sources dot redhat dot com>
- Date: Tue, 21 Mar 2006 12:00:13 +0100
- Subject: RE: PATCH: Disable dynamic allocation in atexit
> -----Original Message-----
> From: newlib-owner@sourceware.org
> One thing to bear in mind is that C++ applications will
> register an atexit function for every statically allocated
> object with a destructor.
> For example:
>
> struct S { ~S(); };
> S s;
>
> will result in an atexit call to clean up "s".
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?