avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Heap management


From: Ron
Subject: [avr-libc-dev] Heap management
Date: Thu, 10 Nov 2005 21:18:29 +1100

For some time I have been using a set of heap allocation functions with
WinAVR that I developed in C and based on a C++ class proposed by Bruno
Preiss. Bruno's work is in the public domain and consequently so is
this. IMHO it seems to perform better than the existing library
functions, particularly at high fragmentation levels. 

It uses about a dozen more words of flash than the current version, is
block organised (ie minimum allocation is a block - minimum block size
is 8 bytes), 6 bytes overhead for a block on the free list and the usual
2 bytes for the first block of an allocated area (area = one or more
blocks). The minimum area that can be allocated for a user is therefore
6 bytes. The signatures for the three functions (malloc/realloc/free)
are C standard.

J"org has suggested the possibility of providing a selection of heap
allocators a user could select from that suit their particular
application, and that sounds a good idea to me.

I have put a description of the code and a downloadable version for
AVRgcc on http://www.jennaron.com.au/avr/DoublyLinkedMemory.html. I am
happy to participate in whatever steps are necessary.

Cheers, Ron






reply via email to

[Prev in Thread] Current Thread [Next in Thread]