[uClibc]looking for a smarter malloc

Erik Andersen andersen at codepoet.org
Fri Jul 5 22:25:41 UTC 2002


On Fri Jul 05, 2002 at 06:16:17PM +0200, Ronald Wahl wrote:
> Hi,
> 
> is there a way to use the malloc from glibc with uClibc? I'm under the
> impression that the glibc malloc makes more effort in giving unused
> memory back to the system. AFAIK it uses a comination of brk/sbrk and
> mmap.

The latest malloc from glibc is _not_ more efficient than the
malloc-930716 code currently in uClibc.  For all allocations
that are likely to occur, both use brk/sbrk (which is the fastest
method available).  Try doing some time tests... I have.  

The main differences are that the latest malloc from glibc 1)
adds a lot of debugging support that IMHO is actually dangerous
since by default it tends to hide buffer overflows and 2) it uses
a hybrid allocation approach, such that for massive allocations
it uses mmap.  So far, I've havn't seen the need for such
overhead.

Are you seeing a performance problem?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list