[ECOS] memory alloc question
Fri Feb 22 09:40:00 GMT 2002
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
More information about the Ecos-discuss