MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / increment_usage

Method increment_usage

src/common/classes/alloc.h:121–129  ·  view source on GitHub ↗

These methods are thread-safe due to usage of atomic counters only

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 1

exchangeAddMethod · 0.80

Tested by

no test coverage detected