[Olsr-dev] memory related mapper functions and DL malloc

Hendrik Scholz (spam-protected)
Fri May 23 21:41:10 CEST 2008


Hi!

I've added olsr_ prefixes to all free() and calloc() calls to be in sync
with olsr_malloc().

The patch can be found here:
http://dump.wormulon.net/olsr/20080523-mem_wrapper.patch

While this clearly isn't anything interesting on its own I used it to
implemented Doug Lea's malloc() implementation as described on
http://g.oswego.edu/dl/html/malloc.html
In a nutshell it implements bookkeeping functionality in userland and
prevents constant system calls to allocate/free memory.

A patch for both the wrapper function names as well as the
DL malloc is here:
http://dump.wormulon.net/olsr/20080523-mem_wrapper_with_dl_malloc.patch

DL malloc is known to make malloc() and free() amazingly fast while
not wasting memory. From previous applications I know that it
uses a little bit more memory but the performance was more than worth it.

Notes:

- both patches against the Mercurial HEAD
- set DL_MALLOC to 1 in Makefile.inc
- the whole patch only applies to the main runtime part not the
   src/cfgparser (yet)
- I only did testing between two olsr instances, no live traffic!
- mremap() did work as I wanted it to so it is disabled right now

Profiling is currently broken on Ubuntu so my performance testbed
has yet to be set up.

Cheers,
  Hendrik

-- 
Hendrik Scholz <(spam-protected)>




More information about the Olsr-dev mailing list