Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jul 2006 16:51:11 +0000 (UTC)
From:      Jason Evans <jasone@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/lib/libc/stdlib malloc.c
Message-ID:  <200607011651.k61GpBLq006143@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jasone      2006-07-01 16:51:11 UTC

  FreeBSD src repository

  Modified files:
    lib/libc/stdlib      malloc.c 
  Log:
  Use some math tricks in arena_run_reg_dalloc() to avoid actual division, as
  well as avoiding a switch statement.  This change has no significant impact
  to performance when branch prediction is successful at predicting the sizes
  of objects passed to free(), but in the case that the object sizes are
  semi-random, this change has the potential to prevent many branch prediction
  misses, thus improving performance substantially.
  
  Take advantage of alignment guarantees in ipalloc(), and pad object sizes to
  something less than a power of two when possible.  This has the potential
  to substantially reduce internal fragmentation for objects allocated via
  posix_memalign().
  
  Avoid an unnecessary pow2_ceil() call in arena_ralloc().
  
  Submitted by:   djam8193ah@hotmail.com
  
  Revision  Changes    Path
  1.129     +90 -83    src/lib/libc/stdlib/malloc.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607011651.k61GpBLq006143>