These methods are thread-safe due to usage of atomic counters only
| 119 | |
| 120 | // These methods are thread-safe due to usage of atomic counters only |
| 121 | void increment_usage(size_t size) noexcept |
| 122 | { |
| 123 | for (MemoryStats* statistics = this; statistics; statistics = statistics->mst_parent) |
| 124 | { |
| 125 | const size_t temp = statistics->mst_usage.exchangeAdd(size) + size; |
| 126 | if (temp > statistics->mst_max_usage) |
| 127 | statistics->mst_max_usage = temp; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void decrement_usage(size_t size) noexcept |
| 132 | { |
nothing calls this directly
no test coverage detected