[Gllug] mallinfo

Alain Williams addw at phcomp.co.uk
Tue Oct 30 19:18:46 UTC 2007


On Tue, Oct 30, 2007 at 07:15:41PM +0000, Martin A. Brooks wrote:
> - 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.

Depends on the problem. It can't always be done, it usually attracts
some kind of penalty.

-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list