I'm looking to utilize the atomic TBB construct across a library API I am developing. I am aware of the C++ ABI dragons that be there (and can work around them), but I do not know very much about the binary layout of the atomic data structure.
In order to make sure I can use atomic in my interface, I'd like to find out if I can assert a fixed binary representation for atomic where T is a known size (e.g., 16- or 32-bit integral).
Is this achievable? Are there compiler settings I need to be aware of that could throw off this assertion (e.g., alignment and/or padding settings)? I'm using gcc on the Mac and MSVC on Windows. Any help here would be greatly appreciated. Thanks in advance!