equal
deleted
inserted
replaced
43 class GlobalCounter : public AllStatic { |
43 class GlobalCounter : public AllStatic { |
44 private: |
44 private: |
45 // Since do not know what we will end up next to in BSS, we make sure the |
45 // Since do not know what we will end up next to in BSS, we make sure the |
46 // counter is on a seperate cacheline. |
46 // counter is on a seperate cacheline. |
47 struct PaddedCounter { |
47 struct PaddedCounter { |
48 DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE/2, 0); |
48 DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); |
49 volatile uintx _counter; |
49 volatile uintx _counter; |
50 DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE/2, sizeof(volatile uintx)); |
50 DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(volatile uintx)); |
51 }; |
51 }; |
52 |
52 |
53 // The global counter |
53 // The global counter |
54 static PaddedCounter _global_counter; |
54 static PaddedCounter _global_counter; |
55 |
55 |