[PATCH]: Pool allocation of a few structures

Daniel Berlin dberlin@dberlin.org
Tue Dec 17 16:13:00 GMT 2002



On Tue, 17 Dec 2002, Zack Weinberg wrote:

> Daniel Berlin <dberlin@dberlin.org> writes:
>
> > This patch includes a pool based allocator for fixed size objects, and
> > uses it for et-forest things and basic blocks, to improve locality.
> > This does better than the patch i submitted yesterday, it knocks 12
> > seconds (out of 26) off branch prediction rather than 10, and improves
> > cache locality of basic block traversals.
>
> I think this is a fine idea.  I would suggest that you put
> alloc-pool.c over in libiberty.  Also, you might want to think about
> using a slab-like algorithm for even better data locality and
> cacheline coloring (this would be an additional refinement).

Actually, I forgot, but libbanshee (on the tree-ssa branch) includes
region stuff in it's libraries (which will compile without the rest of
libbanshee, it's 4 files). It was built for a recent (2001 or 2) thesis on
region based allocation, and does smart things like staggering subregions across
cache lines, etc.
I'll try it as the underlying allocator in the pool (rather than
malloc) and see how it does, since it will likely handle data locality
better than changing the pool itself would.



 > > zw >



More information about the Gcc-patches mailing list