Changeset View
Changeset View
Standalone View
Standalone View
src/support/lockedpool.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | for (const auto &chunk : chunks_used) | ||||
r.used += chunk.second; | r.used += chunk.second; | ||||
for (const auto &chunk : chunks_free) | for (const auto &chunk : chunks_free) | ||||
r.free += chunk.second; | r.free += chunk.second; | ||||
r.total = r.used + r.free; | r.total = r.used + r.free; | ||||
return r; | return r; | ||||
} | } | ||||
#ifdef ARENA_DEBUG | #ifdef ARENA_DEBUG | ||||
void printchunk(char *base, size_t sz, bool used) { | static void printchunk(char *base, size_t sz, bool used) { | ||||
std::cout << "0x" << std::hex << std::setw(16) << std::setfill('0') << base | std::cout << "0x" << std::hex << std::setw(16) << std::setfill('0') << base | ||||
<< " 0x" << std::hex << std::setw(16) << std::setfill('0') << sz | << " 0x" << std::hex << std::setw(16) << std::setfill('0') << sz | ||||
<< " 0x" << used << std::endl; | << " 0x" << used << std::endl; | ||||
} | } | ||||
void Arena::walk() const { | void Arena::walk() const { | ||||
for (const auto &chunk : chunks_used) | for (const auto &chunk : chunks_used) | ||||
printchunk(chunk.first, chunk.second, true); | printchunk(chunk.first, chunk.second, true); | ||||
std::cout << std::endl; | std::cout << std::endl; | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |