Reply by Marko Panger January 18, 20062006-01-18
Hi,

(I'm resending this as I'm experiencing some mail problems - sorry if
it will be
doubled)

You might check my simple implementation in my uSmartX-RTOS. There is
also a
doubly linked list implementation.

http://usmartx.sourceforge.net/

Hope it helps,
marko --- In lpc2000@lpc2..., Marko Pavlin <mp@h...> wrote:
>
> Hello!
>
> I am looking for simple dynamic memory allocation management for
> LPC213x. I need some segmentation for using simple, variable length
> linked lists. Priority is speed.
>
> Could someone point me to some "c" sources?
>
> Thanks! > Marko
>


An Engineer's Guide to the LPC2100 Series

Reply by Paul Curtis January 18, 20062006-01-18
Hi,

> >I am looking for simple dynamic memory allocation management for
> >LPC213x.
> >
> In C you may use malloc(), alloc() and free.

In many cases this is a simple thing to do, but it's probably not the
best thing you can do. I would hazard a guess that most implementations
of these functions in standard offerings are rather poor. They will
have low code overhead, use memory efficiently, and have O(n)
performance when n is the number of blocks in the free list. They will
suffer from fragmentation, of course. You'll probably want to replace
that with a system that suits your needs--ones that are fast require
more memory or waste memory in each allocated block. Ones that two to
conserve memory will be slow. The ones provided by compiler libraries
will be ones that satisfy the needs of the C standard and programs in
general, and won't serve the needs of all users. Hybrid schemes are
attractive, with small blocks that are allocated and deallocated
frequently using a different manager from blocks that are big (for some
definition of big).

Having written many memory managers in my time, for interpreted and
compiled languages, there is no one solution for any application.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and now MAXQ processors



Reply by Paul Curtis January 18, 20062006-01-18
Hi,

> I am looking for simple dynamic memory allocation management for
> LPC213x. I need some segmentation for using simple, variable length
> linked lists. Priority is speed.

If your priority is SPEED then do not use a linked list. Try
researching buddy systems (such as Fibonacci and binary buddy systems).

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for MSP430, ARM, AVR and now MAXQ processors



Reply by Micron Engineering January 18, 20062006-01-18
Marko Pavlin ha scritto:

>Hello!
>
>I am looking for simple dynamic memory allocation management for
>LPC213x.
>
In C you may use malloc(), alloc() and free.

>I need some segmentation for using simple, variable length
>linked lists. Priority is speed.
You may find any algorithm book with C or C++ source. Of course to add
an element from the list you have to alloca some space before to connect
next element to the list (also insert have the same necessity) and for
remove you have to disconnect the list item and then deallocate some
space. In my opinion you may find pool algorithms and use a memory pool
to allocate/free memory for the list because it permits a better memory
usage. Of course you have to define the maximum pool size but of course
memory is phisically limited.

>Could someone point me to some "c" sources?
>
>Thanks! >Marko >
>Yahoo! Groups Links


----------



Reply by Marko Pavlin January 18, 20062006-01-18
Hello!

I am looking for simple dynamic memory allocation management for
LPC213x. I need some segmentation for using simple, variable length
linked lists. Priority is speed.

Could someone point me to some "c" sources?

Thanks! Marko