On Tue, Mar 18, 2008, Henrik Nordstrom wrote:

> Does it? Most mallocs I know about has details about the allocated
> region just before the pointer (and optional red zone). 

http://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemalloc.pdf


<quote>
   Small allocations are segregated such that each run manages a single size 
class. A region bitmap is
stored at the beginning of each run, which has several advantages over other 
methods:
   * The bitmap can be quickly scanned for the first free region, which allows 
tight packing of in-use
     regions.
   * Allocator data and application data are separate. This reduces the 
likelihood of the application
     corrupting allocator data. This also potentially increases application 
data locality, since allocator
     data are not intermixed with application data.
   * Tiny regions can be easily supported. This would be more difficult if, for 
example, a free list were
     embedded in the free regions.
</quote>

Both phkmalloc and jemalloc tried to avoid "cache thrashing" which involves
having to walk a sparse data structure resulting in a possible TLB/L2 cache miss
for each touch of the data structure.




Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -

Reply via email to