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

Jason Evans jasone at
Wed Mar 28 19:55:08 UTC 2007

jasone      2007-03-28 19:55:07 UTC

  FreeBSD src repository

  Modified files:
    lib/libc/stdlib      malloc.c 
  Remove the run promotion/demotion machinery.  Replace it with red-black
  trees that track all non-full runs for each bin.  Use the red-black
  trees to be able to guarantee that each new allocation is placed in the
  lowest address available in any non-full run.  This change completes the
  transition to allocating from low addresses in order to reduce the
  retention of sparsely used chunks.
  If the run in current use by a bin becomes empty, deallocate the run
  rather than retaining it for later use.  The previous behavior had the
  tendency to spread empty runs across multiple chunks, thus preventing
  the release of chunks that were completely unused.
  Generalize base_chunk_alloc() (and rename it to base_pages_alloc()) to
  handle allocation sizes larger than the chunk size, so that it is
  possible to support chunk sizes that are smaller than an arena object.
  Reduce the minimum chunk size from 64kB to 8kB.
  Optimize tracking of addresses for deleted chunks.
  Fix a statistics bug for huge allocations.
  Revision  Changes    Path
  1.145     +221 -432  src/lib/libc/stdlib/malloc.c

More information about the cvs-src mailing list