template <class V>
template <class Visitor>
void
-SplayNode<V>::visit(Visitor &visitor) const {
+SplayNode<V>::visit(Visitor &visitor) const
+{
if (left)
left->visit(visitor);
visitor(data);
template <class V>
template <class Visitor>
void
-Splay<V>::visit(Visitor &visitor) const {
+Splay<V>::visit(Visitor &visitor) const
+{
if (head)
head->visit(visitor);
}
virtual bool mayStartSwapOut();
virtual void trimMemory(const bool preserveSwappable);
- // called when a decision to cache in memory has been made
+ // called when a decision to cache in memory has been made
void memOutDecision(const bool willCacheInRam);
// called when a decision to cache on disk has been made
void swapOutDecision(const MemObject::SwapOut::Decision &decision);
const int slotLimit = slotLimitActual();
storeAppendPrintf(&e, "Maximum entries: %9d\n", entryLimit);
if (map && entryLimit > 0) {
- const int entryCount = map->entryCount();
- storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n",
- entryCount, (100.0 * entryCount / entryLimit));
+ const int entryCount = map->entryCount();
+ storeAppendPrintf(&e, "Current entries: %9d %.2f%%\n",
+ entryCount, (100.0 * entryCount / entryLimit));
}
storeAppendPrintf(&e, "Maximum slots: %9d\n", slotLimit);
if (map && slotLimit > 0) {
- const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size();
- if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
- const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
- storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n",
- usedSlots, (100.0 * usedSlots / slotLimit));
- }
- if (slotLimit < 100) { // XXX: otherwise too expensive to count
- Ipc::ReadWriteLockStats stats;
- map->updateStats(stats);
- stats.dump(e);
- }
+ const unsigned int slotsFree = !freeSlots ? 0 : freeSlots->size();
+ if (slotsFree <= static_cast<const unsigned int>(slotLimit)) {
+ const int usedSlots = slotLimit - static_cast<const int>(slotsFree);
+ storeAppendPrintf(&e, "Used slots: %9d %.2f%%\n",
+ usedSlots, (100.0 * usedSlots / slotLimit));
+ }
+ if (slotLimit < 100) { // XXX: otherwise too expensive to count
+ Ipc::ReadWriteLockStats stats;
+ map->updateStats(stats);
+ stats.dump(e);
+ }
}
storeAppendPrintf(&e, "Pending operations: %d out of %d\n",
}
Ipc::StoreMap::Anchor&
-Ipc::StoreMap::anchorAt(const sfileno fileno) {
+Ipc::StoreMap::anchorAt(const sfileno fileno)
+{
assert(validEntry(fileno));
return anchors->items[fileno];
}
const Ipc::StoreMap::Anchor&
-Ipc::StoreMap::anchorAt(const sfileno fileno) const {
+Ipc::StoreMap::anchorAt(const sfileno fileno) const
+{
return const_cast<StoreMap&>(*this).anchorAt(fileno);
}
}
Ipc::StoreMap::Slice&
-Ipc::StoreMap::sliceAt(const SliceId sliceId) {
+Ipc::StoreMap::sliceAt(const SliceId sliceId)
+{
assert(validSlice(sliceId));
return slices->items[sliceId];
}
const Ipc::StoreMap::Slice&
-Ipc::StoreMap::sliceAt(const SliceId sliceId) const {
+Ipc::StoreMap::sliceAt(const SliceId sliceId) const
+{
return const_cast<StoreMap&>(*this).sliceAt(sliceId);
}
public:
/// aggregates anchor and slice owners for Init() caller convenience
- class Owner {
+ class Owner
+ {
public:
Owner();
~Owner();
* to start swapping the entry out.
*/
void
-StoreEntry::transientsAbandonmentCheck() {
+StoreEntry::transientsAbandonmentCheck()
+{
if (mem_obj && !mem_obj->smpCollapsed && // this worker is responsible
- mem_obj->xitTable.index >= 0 && // other workers may be interested
- mem_obj->memCache.index < 0 && // rejected by the shared memory cache
- mem_obj->swapout.decision == MemObject::SwapOut::swImpossible) {
+ mem_obj->xitTable.index >= 0 && // other workers may be interested
+ mem_obj->memCache.index < 0 && // rejected by the shared memory cache
+ mem_obj->swapout.decision == MemObject::SwapOut::swImpossible) {
debugs(20, 7, "cannot be shared: " << *this);
if (!shutting_down) // Store::Root() is FATALly missing during shutdown
Store::Root().transientsAbandon(*this);
}
void
-StoreEntry::memOutDecision(const bool willCacheInRam) {
+StoreEntry::memOutDecision(const bool willCacheInRam)
+{
transientsAbandonmentCheck();
}
void
-StoreEntry::swapOutDecision(const MemObject::SwapOut::Decision &decision) {
+StoreEntry::swapOutDecision(const MemObject::SwapOut::Decision &decision)
+{
// Abandon our transient entry if neither shared memory nor disk wants it.
assert(mem_obj);
mem_obj->swapout.decision = decision;
if (getType() == STORE_DISK_CLIENT) {
// we should have called startSwapin() already
assert(swapin_sio != NULL);
- } else
- if (!swapin_sio && !startSwapin()) {
+ } else if (!swapin_sio && !startSwapin()) {
debugs(90, 3, "bailing after swapin start failure for " << *entry);
assert(!flags.store_copying);
return;