A C++ memory location is either an object of scalar type or a sequence of adjacent bit-fields. An object occupies at least one memory location; adjacent bit-fields share one, even though they are distinct objects. Fundamental-type variables each occupy exactly one memory location, regardless of size or adjacency. section 5.1.1
Bit-fields in a struct
In the illustrated struct, adjacent bit-fields bf1 and bf2 share a memory location. An unnamed zero-length bit-field separates bf4 into its own location but occupies none itself. The example shows why object boundaries and memory-location boundaries are not always the same. section 5.1.1
Concurrency safety depends on which locations threads access. Concurrent reads of the same location are safe, but if either thread writes, accesses need an enforced ordering. Without ordering, conflicting non-atomic accesses constitute a data race and cause undefined behavior. Mutexes or atomic operations can establish ordering. section 5.1.2
Use the struct diagram to distinguish objects, subobjects, and the memory locations they occupy. section 5.1.1


