[Gllug] mallinfo

Martin A. Brooks martin at hinterlands.org
Tue Oct 30 19:15:41 UTC 2007


- Tethys wrote:
> Since you've stated the goal is to keep track of the total amount of
> memory malloc()ed, then the sum of the two fields is what you're
> looking for. Explicitly checking for zero in arena could lead to all
> sorts of interesting behaviour. Consider the case where most of the
> memory is allocated with mmap(2), but a small amount is allocated with
> sbrk(2), for example.

The correct solution is, of course, to write your code in a language 
with automatic memory management.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list