Defined as follows:
class GlobalCounter : public AllStatic {
private:
// Since do not know what we will end up next to in BSS, we make sure the
// counter is on a seperate cacheline.
struct PaddedCounter {
DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE/2, 0);
volatile uintx _counter;
DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE/2, sizeof(volatile uintx));
};
Why "/2"? Every other use of DEFINE_PAD_MINUS_SIZE macro uses the full cache line size, and it is sensible: you can have two values *at the same cache line* separated by half of its width, unless the whole thing is cache-line-aligned.
This also sets up for awkward accidents when others copy-paste this padding block as example for padding elsewhere.