This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Decrease integer-share-limit
On Thu, 16 Aug 2012, Jakub Jelinek wrote:
> On Thu, Aug 16, 2012 at 04:44:03PM +0200, Richard Guenther wrote:
> > On Thu, 16 Aug 2012, Paolo Carlini wrote:
> > > On 08/16/2012 03:39 PM, Richard Guenther wrote:
> > > > This decreases the integer-share-limit to make sure the TREE_VEC we
> > > > allocate for the small cached integers has a reasonable size for
> > > > our GC memory allocator.
> > > Out of curiosity (just in case you hav two spare minutes) do you have any idea
> > > why this is so? I mean, naively one would think that allowing for any 8 bit
> > > constant would be a nice idea; puzzlingly, however the comment in the code
> > > says just "experimentation". I'm wondering if tweaking a bit the memory
> > > allocator itself could allow for the full 8 bit range without a big memory
> > > waste...
> >
> > The GC memory allocator works on "pages", there are not pages of
> > arbitrary size but only power-of-two sizes. It's hard to improve
> > the allocator here.
>
> The allocations are either power-of-two, or a couple of extra listed sizes.
> So, the alternative would be to add an extra size for the default integer
> share limit vector. See extra_order_size_table in ggc-page.c. Of course
> only provided there are many of those vectors.
I doubt that a special size of 2080 / 1040 would be a good thing.
(I doubt we make very good use of most of the small integer share
vectors anyway, but that's for another thing ...)
I've now applied the patch.
Richard.