memory allocation

Joel Sherrill joel.sherrill at OARcorp.com
Mon May 6 11:24:58 UTC 2002



Jan Suchotzki wrote:
> 
> Hi,
> 
> I have question related to memory allocation. I've seen the partition and region manager. Where are the differences and what about malloc?

region --> variable blocks
partition --> fixed blocks

malloc is implemented as a region

> I need a big block of memory (~200-500 kB). In one case I need a contiguous block in another case I need two contiguous blocks. Which is the most efficient way to allocate such an amount of memory, and why?

I don't know how much memory you have on your board or what type of
alignment
requirements but I would tend to handle this in the linker script.  If
you
go with malloc you will have to handle the alignment yourself.  If you
go
with partition, you will have to find the memory yourself (malloc or
linker 
script) to only allocate a few blocks.

> With kind regards
> 
> Jan Suchotzki

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list