Are there any alignment guarantees for exception memory allocated through Itanium ABI?

Itanium ABI states that memory for an exception is obtained by calling __cxa_allocate_exception(size) . What is the guarantee of alignment of returned memory?

+7
c ++
source share
1 answer

Section 1.2 of chapter 4 states:

The unwind interface uses a pointer to the exception header object as its representation of the exception. In general, a complete representation of an exception object is language and implementation specific, but it will be a prefix header, an understandable unwinding interface that is defined as follows:

followed by the definition of struct _Unwind_Exception , and then:

The _Unwind_Exception object must be double word aligned.

Since this is the prefix of the exception object as a whole, the entire memory block must be aligned with a double word.

Perhaps this text does not prohibit arbitrary padding found before _Unwind_Exception , but if so, then the answer is that there is no guarantee of alignment; I prefer to interpret this as a minor flaw in the wording.

+6
source share

All Articles