This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix g++.eh/badalloc.C failure
Richard Henderson wrote:
> As an aside, the code here appears confused. I'd check this
> in, except that c++ is failing all tests again on Alpha. :-(
> ! arena[pos] = size;
> ! size = (size + 4 * sizeof (__SIZE_TYPE__) - 1)
> ! / sizeof (__SIZE_TYPE__) & ~3; // Yes, this is a hack
> ! pos += size + 4;
> ! return p + 4;
These '4's are an attempt at padding the allocation to some large alignment.
Without them you are presuming that __SIZE_TYPE__ is the most strict
alignment, which I know is untrue on some systems. Should have
commented that one ...
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
firstname.lastname@example.org : http://www.cs.bris.ac.uk/~nathan/ : email@example.com