On Tue, 26 Feb 2013, Jakub Jelinek wrote:

> The following patch attempts to fix that by allocating strings which we want
> to keep allocated forever, and from time to time lose all the pointers
> pointing to them, in an obstack.  That could in theory make the allocations
> tiny bit faster, but more importantly all the memory is reachable at exit
> and thus valgrind doesn't complain about those.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.  (The idea behind not freeing data here, apart from the total amount 
being at most a constant times the size of the command line, is that to 
free data you'd then need to keep track of what was allocated and what was 
pointing into argv, or strdup everywhere a pointer into argv is used, and 
probably wouldn't actually end up saving any memory.)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to