c – 通过Itanium ABI分配的异常内存是否有任何对齐保证?

Itanium ABI声明通过调用__cxa_allocate_exception(size)获得异常的内存.返回内存的对齐保证是什么?

解决方法

Section 1.2 in chapter 4说:

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:

接下来是struct _Unwind_Exception的定义,后跟:

An _Unwind_Exception object must be double-word aligned.

由于这是异常对象的前缀,因此整个内存块必须是双字对齐的.

可以说这个文本并没有禁止在_Unwind_Exception之前找到任意填充,但是如果这种情况是这样的,那么答案是没有任何对齐保证;我选择将此解释为次要措辞缺陷.

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...