In order to use OSAtomicDecrement (mac-specific atomic operation), I need to provide a 4-byte aligned SInt32.
Does this kind of cooking work ? Is there another way to deal with alignment issues ?
struct SomeClass {
SomeClass() {
member_ = &storage_ + ((4 - (&storage_ % 4)) % 4);
*member_ = 0;
}
SInt32 *member_;
struct {
SInt32 a;
SInt32 b;
} storage_;
};