[patch-rfc] N2179: Exception Propagation in C++

Peter Dimov pdimov@mmltd.net
Wed Aug 13 22:42:00 GMT 2008


> Hi,
>
>> I can make it an int, but this may cause an ambiguity in the
>> ABI description for 64-bit targets. Can I rely on the structure
>> padding rules in the ABI to ensure cross-compiler compatibility, or
>> do I need to pad this manually? And if I do, how do I best do this?
>
> To be clear, an _Atomic_word, like in the attached which I quickly hacked, 
> untested (if you can, please double check the reference counting for 
> off-by-one errors, thanks in advance).

A union { size_t __dummy; _Atomic_word __refs; } should work, as long as 
sizeof(size_t) >= sizeof(_Atomic_word). 



More information about the Libstdc++ mailing list