This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: anybody use mallinfo?


That was it.

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: Tuesday, August 17, 2004 5:57 PM
To: von Lehe, Richard H
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] anybody use mallinfo?


On Tue, Aug 17, 2004 at 05:48:32PM -0500, Richard.von.Lehe@gd-ais.com wrote:
> Hi All,
> 

> I thought I would experiment to see if mallinfo is usable and maybe
> use it to get an idea of how much heap we're using.  I created a
> simple test program that spits out the mallinfo struct before a
> 'new', after a 'new', and after a 'delete'.  I thought that the
> pre-new and post-delete values would be the same, but it didn't turn
> out that way.

> The uordblocks increases by 1008 after 'new'ing 1000 chars.  I would
> have thought it should be 1000, but whatever. 

The heap code needs some overhead to keep track of allocated
memory. That is what the 8 bytes are for.

> Then, it doesn't
> decrease after the 'delete []' call.  Does all this just mean that
> the implementation of mallinfo is not complete and I should stay
> away from it or am I misunderstanding something?

You might be missing CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]