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]

Re: [patch]: new returns misaligned pointers


>>>>> "Diego" == Diego Novillo <dnovillo@cygnus.com> writes:

    Diego> The problem is that this cookie header is created with
    Diego> double_type_node alignment which is 8, not 16. Therefore,
    Diego> the actual pointer returned by `new' is misaligned.

Makes sense.  Could you mention for which ports this makes a
difference?  If it does make a difference with an existing port, does
it still work to use new/delete across old and new .o files?

I'm sure Jason already went through this with you, so you needn't
really answer, but I'm curious.

    Diego> The patch below addresses this problem. It aligns the
    Diego> cookie header to BIGGEST_ALIGNMENT to avoid returning
    Diego> misaligned pointers with `new'.

Good.  Thanks for adding the comment!

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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