This is the mail archive of the
mailing list for the eCos project.
Re: memory alloc question
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Tom Coremans <tom dot coremans at acunia dot com>
- Cc: eCos users <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 22 Feb 2002 17:23:41 +0000
- Subject: Re: [ECOS] memory alloc question
- Organization: Red Hat UK Ltd.
- References: <3C73C5A1.4AAB6459@acunia.com>
Tom Coremans wrote:
> I`m wondering what the maximum size is that I can allocate to a memory
> pool in ECOS.
I don't think there's any strict limit.
> I`m planning to use a memory pool as the heap for a virtual machine so
> it should be as big as possible when I allocate it.
> What is the best aproach?? Using malloc to obtain a pointer to a free
> block that I use to construct the pool or declaring a global varible of
> x bytes that I use as the base adres for the pool?
It depends what you are trying to achieve. Using a global variable means
you don't have to pull in any malloc code, but means the allocated variable
is always there. Maybe that's not a problem.
Obviously you could just use malloc if you wanted, so I assume there's some
reason such as determinism/speed you don't want to.
> In the ecos configtool you can enter the size of the fallback dynamic
> memory pool..
> Does it have anything to do with this?
That's a fallback for the very small number of targets that don't export
"heap" information, so the generic memory allocator code doesn't know how
much memory the target has.
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss