memcache: fix cache::item_footprint()
size of the sstring _ascii_prefix should also be added when computing item footprint. Without this change, reclaimer would end up evicting more than needed. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
committed by
Avi Kivity
parent
466acedcb2
commit
48019c2df2
@@ -733,7 +733,7 @@ private:
|
||||
memory::reclaimer _reclaimer;
|
||||
private:
|
||||
size_t item_footprint(item_type& item_ref) {
|
||||
return sizeof(item_type) + item_ref._data.size() + item_ref.key().size();
|
||||
return sizeof(item_type) + item_ref._data.size() + item_ref._ascii_prefix.size() + item_ref.key().size();
|
||||
}
|
||||
|
||||
template <bool IsInCache = true, bool IsInTimerList = true>
|
||||
|
||||
Reference in New Issue
Block a user