Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » AVR-GCC
  • » [avr-gcc-list] Doubly Linked Memory Pool [RSS Feed]

#1 Nov. 8, 2005 02:29:33

R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Doubly Linked Memory Pool


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. IMHO it seems to perform better than the existing
malloc/realloc/free functions in the library, particularly at high
fragmentation levels.

While that is just my experience, I have put a description of the code
and a version for AVRgcc onhttp://www.jennaron.com.au/avr/DoublyLinkedMemory.html. I would
appreciate others giving it a good thrashing and if it stands up, with
the possibility (without being presumptuous) of including it in the
distribution.

Ron




_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Nov. 8, 2005 19:55:31

Eric W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Doubly Linked Memory Pool


Ron wrote: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. IMHO it seems to perform better than the existing
malloc/realloc/free functions in the library, particularly at high
fragmentation levels.

While that is just my experience, I have put a description of the code
and a version for AVRgcc onhttp://www.jennaron.com.au/avr/DoublyLinkedMemory.html. I would
appreciate others giving it a good thrashing and if it stands up, with
the possibility (without being presumptuous) of including it in the
distribution.What exactly did you have in mind? Would this replace malloc() et al.?or does this "augment" malloc()?If this would be a potential replacement, would you mind discussing thison the avr-libc-dev mailing list? All of the developers of avr-libc areon that list and it's probably more appropriate to discuss it there.Thanks!

--
Eric Weddington


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Nov. 8, 2005 20:26:28

Joerg W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[avr-gcc-list] Doubly Linked Memory Pool


"Ron" <> wrote:

> IMHO it seems to perform better than the existing
> malloc/realloc/free functions in the library, particularly at high
> fragmentation levels.

Btw., the current implementation has not been chosen to be as fast as
possible, but to use as little resources as possible. This seems to
be what usually concerns people most. So, for any allocated chunk,
two bytes overhead are needed to record the chunk's size, while no
link pointers are kept. Once the chunk is freed, a link pointer is
placed into what used to be the chunk's payload before.

Obviously, doubly linked lists will perform better, no question.
(Also, I remember a suggestion to compact the existing code a bit, I
have to dig that up in my archives again.)

I've been thinking about the idea to offer different levels of a
malloc() implementation so the users have a choice (as separate
libraries, similar to the printf and scanf choices). Level 1 would
then be avr-libc's historic implementation which was very simple but
prone to fragmentation, yet for someone who just wants to allocate and
free chunks of the very same size, it would save quite a bit of code.
Level 2 could then be the current implementation, and I can imagine of
your implementation becoming level 3: it needs even more resources (at
least in terms of RAM overhead), but performs better. Obviously, that
would require that it is 1) a plug-compatible replacement, and 2) can
be made available under the established avr-libc licensing terms.
(Maybe a bucket implementation could also be a candidate, as they are
typically used in modern OS's memory allocators.)

As Eric said, if you're interested, avr-libc-dev is the more
appropriate list to discuss that.

--
cheers, J"org .-.-. --... ...-- -.. . DL8DTLhttp://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

  • Root
  • » AVR-GCC
  • » [avr-gcc-list] Doubly Linked Memory Pool [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support