[uClibc-cvs] uClibc/extra/Configs Config.in,1.41,1.42

Erik Andersen andersen at uclibc.org
Tue Dec 30 10:40:50 UTC 2003


Update of /var/cvs/uClibc/extra/Configs
In directory nail:/tmp/cvs-serv5823/extra/Configs

Modified Files:
	Config.in 
Log Message:
Rework malloc.  The new default implementation is based on dlmalloc from Doug
Lea.  It is about 2x faster than the old malloc-930716, and behave itself much
better -- it will properly release memory back to the system, and it uses a
combination of brk() for small allocations and mmap() for larger allocations.
 -Erik


Index: Config.in
===================================================================
RCS file: /var/cvs/uClibc/extra/Configs/Config.in,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- Config.in	4 Dec 2003 18:25:36 -0000	1.41
+++ Config.in	30 Dec 2003 10:40:47 -0000	1.42
@@ -287,24 +287,36 @@
 
 choice
 	prompt "Malloc Implementation"
-	default MALLOC_930716
+	default MALLOC if ! UCLIBC_HAS_MMU
+	default MALLOC_STANDARD if UCLIBC_HAS_MMU
 	help
 	  "malloc" use mmap for all allocations and so works very well on MMU-less
 	  systems that do not support the brk() system call.   It is pretty smart
 	  about reusing already allocated memory, and minimizing memory wastage.
+	  This is the default for uClinux MMU-less systems.
 
-	  "malloc-930716" is derived from libc-5.3.12 and uses the brk() system call
-	  for all memory allocations.  This makes it very fast.  It is also pretty
-	  smart about reusing already allocated memory, and minimizing memory wastage.
-	  Because this uses brk() it will not work on uClinux MMU-less systems.
+	  "malloc-simple" was written from scratch for uClibc, and is the
+	  simplest possible (and therefore smallest) malloc implementation.
+	  It is rather dumb, and certainly isn't the fastest.  But it is 100%
+	  standards compliant, thread safe, and very small.
 
-	  If unsure, answer "malloc".
+	  "malloc-standard" is derived from the public domain dlmalloc
+	  implementation by Doug Lea.  It is quite fast, and is pretty smart
+	  about reusing already allocated memory, and minimizing memory
+	  wastage.  This uses brk() for small allocations, while using mmap()
+	  for larger allocations.  This is the default malloc implementation
+	  for uClibc.
+
+	  If unsure, answer "malloc-standard".
 
 config MALLOC
 	bool "malloc"
 
-config MALLOC_930716
-	bool "malloc-930716"
+config MALLOC_SIMPLE
+	bool "malloc-simple"
+
+config MALLOC_STANDARD
+	bool "malloc-standard"
 	depends on UCLIBC_HAS_MMU
 
 endchoice




More information about the uClibc-cvs mailing list