[ECOS] cyg_mempool_info
Jonathan Larmour
jlarmour@redhat.com
Wed Jun 20 13:56:00 GMT 2001
Srinivasan Sriram wrote:
>
> Hello!
>
> I create a variable memory pool of size 4096.
> A thread claims a block size of 4000.
>
> typedef struct {
> cyg_int32 totalmem;
> cyg_int32 freemem;
> void *base;
> cyg_int32 size;
> cyg_int32 blocksize;
> cyg_int32 maxfree; // The largest free block
> } cyg_mempool_info;
>
> Using this structure I get -
>
> totalmem 4080
> freemem 64
> base 71776
> size 4096
> blocksize -1
> maxfree 64
>
> ---
>
> Though maxfree is 64, I'm unable to even obtain a
> block of 60 from the pool.
That's a bug. In this case it should have been 64-16=48 bytes.
> How did the figure of 64 end up as freemem? (It should
> be more).
Some of the pool is used for metadata stored with each allocation. That's
why maxfree exists (once it works ;-)).
> And how do I compute how much memory is now available
> in the pool so that my mempool_var_alloc will not
> fail?
maxfree once it works.
I'll check in a fix which should appear in anonCVS in the next update.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions http://www.redhat-techworld.com/
More information about the Ecos-discuss
mailing list