This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 ...

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]