DynAlloc Improvements

Well, I’m floundering a little for things to do (other than watch Stargate, and work on a small commercial application, that is) so I had a go at improving DynAlloc, my auto-defragmenting memory allocation library – available from my site separately on the AVR Experiments page, or as a part of MyUSB. The new code is slightly smaller and more efficient than the old.

By making use of the avr-lib-c optimized memory functions memcpy and memset, the need for my own code to replicate the functions is abolished. The avr-lib-c versions are assembly optimized (and thus slightly smaller) but also provides the benefit of being a separately linked function which can be called from the user-code without having to use up more flash than the CALL instruction.

I also changed the way the library works; now the first hole large enough is used, rather than looking for increasingly larger holes. That drastically reduces the number of searches the code has to do, but increases the need for defragmenting. It’s a good tradeoff however – the time used for the defragments should be much smaller than the time wasted doing the repetetive searches for exact-sized holes.

New laptop is awesome. I love the way I can control everything with my voice, mouse/keyboard or mobile phone (via bluetooth). Found some oddities with Vista, but no show-stoppers so far — I’ve been surprised at how well all my AVR tools and software behaves with it.

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS