cvs commit: src/lib/libc/gen src/lib/libc/stdlib malloc.3 malloc.c src/lib/libkse src/lib/libkse/sys lock.c lock.h src/lib/libkse/thread thr_cond.c thr_init.c thr_kern.c thr_mutex.c thr_rtld.c src/lib/libthr ...

Jason Evans jasone at
Fri Mar 7 22:39:40 UTC 2008

jasone      2008-03-07 22:39:39 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    lib/libc/stdlib      malloc.3 malloc.c 
    lib/libkse/sys       lock.c lock.h 
    lib/libkse/thread    thr_cond.c thr_init.c thr_kern.c 
                         thr_mutex.c thr_rtld.c 
    lib/libthr/thread    thr_mutex.c 
  MFC: Merge malloc(3) improvements and fixes.  The highlights are:
  * Avoid re-zeroing memory in calloc() when possible.
  * Use pthread mutexes where possible instead of libc "spinlocks", and
    actually spin some during contention before blocking.
  * Implement dynamic load balancing of thread-->arena mapping.
  * Avoid floating point math in order to avoid increased context switch
    overhead for applications that otherwise would not use floating point
  * Restructure how sbrk() and mmap() are used to acquire memory mappings.
    This provides a way to force malloc to only use sbrk(), which can be
    useful in the context of resource limits.
  * Reduce the number of mmap() calls typically necessary when allocating
    a chunk.
  * Track dirty unused pages so that they can be purged if they exceed a
  * Try to realloc() large objects in place.
  * Manage page runs with trees instead of chunk maps, which allows
    logarithmic-time run allocation.
  Revision   Changes      Path    +1 -0        src/lib/libc/gen/   +95 -36      src/lib/libc/stdlib/malloc.3  +2283 -1341  src/lib/libc/stdlib/malloc.c    +1 -0        src/lib/libkse/   +4 -3        src/lib/libkse/sys/lock.c    +1 -1        src/lib/libkse/sys/lock.h   +1 -1        src/lib/libkse/thread/thr_cond.c   +4 -4        src/lib/libkse/thread/thr_init.c  +5 -5        src/lib/libkse/thread/thr_kern.c   +30 -7       src/lib/libkse/thread/thr_mutex.c    +1 -1        src/lib/libkse/thread/thr_rtld.c   +1 -0        src/lib/libthr/   +23 -6       src/lib/libthr/thread/thr_mutex.c

More information about the cvs-src mailing list