This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug gdb/23768] ubsan runtime error due to misaligned struct member access after XCNEW


https://sourceware.org/bugzilla/show_bug.cgi?id=23768

--- Comment #3 from Simon Marchi <simon.marchi at ericsson dot com> ---
> The concern I have with this approach is that it pessimizes the case of plain scalars, and for tools that are performance-sensitive (such as compilation toolchains), this may not be acceptable, even with the approach you suggest of checking the alignment first.

What do you mean here with pessimization?  In this case:

#define XNEW ((alignof (T) > 8) ? (some_aligned_malloc (sizeof (T), alignof
(T))) : (malloc (sizeof(T))))

scalars will be allocated exactly the same way as before, and the generated
machine code should be the same as before.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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