cvs commit: src/lib/libc/stdlib malloc.c

Jason Evans jasone at FreeBSD.org
Mon Nov 26 19:13:15 PST 2007


jasone      2007-11-27 03:13:15 UTC

  FreeBSD src repository

  Modified files:
    lib/libc/stdlib      malloc.c 
  Log:
  Implement lazy deallocation of small objects.  For each arena, maintain a
  vector of slots for lazily freed objects.  For each deallocation, before
  doing the hard work of locking the arena and deallocating, try several times
  to randomly insert the object into the vector using atomic operations.
  
  This approach is particularly effective at reducing contention for
  multi-threaded applications that use the producer-consumer model, wherein
  one producer thread allocates objects, then multiple consumer threads
  deallocate those objects.
  
  Revision  Changes    Path
  1.150     +218 -0    src/lib/libc/stdlib/malloc.c


More information about the cvs-src mailing list