[patch] Pool allocation

Jules Bergmann jules at codesourcery.com
Wed Jan 30 21:15:40 UTC 2008


Now that 1.4 has been branched ...

This allows memory for blocks to be allocated from special pools.  The 
default pool allocates aligned memory (using alloc_align) similar to the 
status quo.  By using a different pool allocator, memory can be 
allocated from special pools, such as from a pool of huge page memory, 
or from a pool of special DMA memory, etc.

Dense blocks determine their pool from their map, effectively from 
Local_map.

Currently controlling the pool is a bit of hack.  When a Local_map is 
constructed, it captures the current default pool.  This allows you to 
write code like:

	... set pool to X
	
	// create views using pool X
	Vector<...> view(...)

	... set pool to something else

In the future, we could add more elegant ways to set the pool associated 
with a Local map

	Local_map loc_aligned(... aligned pool ...);
	Local_map loc_huge(... use huge pool...)

	Vector<float> small(4, loc_aligned);
	Vector<float> big(16384, loc_huge);

An immediate impact of this patch is that it allows us to use huge pages 
with all of then benchmarks, instead of rewriting them to explicitly 
allocate/use huge pages.

Thought?  Ok to apply?

				-- Jules


-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pool.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20080130/7e0feabb/attachment.ksh>


More information about the vsipl++ mailing list