The Itanium ABI states that memory for an exception is obtained by calling __cxa_allocate_exception(size)
. What is the alignment guarantee of the returned memory?
Section 1.2 in chapter 4 says:
The unwind interface uses a pointer to an exception header object as its representation of an exception being thrown. In general, the full representation of an exception object is language- and implementation-specific, but it will be prefixed by a header understood by the unwind interface, defined as follows:
followed by a definition of struct _Unwind_Exception
, followed by:
An
_Unwind_Exception
object must be double-word aligned.
As this is a prefix to the exception object at large, the entire block of memory must be double-word aligned.
Arguably this text does not prohibit arbitrary padding found before the _Unwind_Exception
, but if this is taken to be the case then the answer is that there is no alignment guarantee whatsoever; I choose to interpret this as a minor wording defect instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With