PATCH: Disable dynamic allocation in atexit

Mark Mitchell mark@codesourcery.com
Tue Mar 21 14:39:00 GMT 2006


Richard Earnshaw wrote:

> Would it be reasonable to make atexit weakly reference malloc, and only
> call it if it's been linked in?  I can't imagine that there would be
> many applications that would blow the static atexit table that wouldn't
> call malloc at least once from some other location.

Yes, that would work too (assuming, of course, that you make the
corresponding change to link "free" in weakly from __call_exitprocs).
It wouldn't be quite as compact, but it would be more automatic.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Newlib mailing list