/*
- * $Id: mem_node.cc,v 1.10 2007/08/13 17:20:51 hno Exp $
+ * $Id: mem_node.cc,v 1.11 2007/12/27 01:58:19 hno Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Robert Collins
static int makeMemNodeDataOffset();
-unsigned long mem_node::store_mem_size;
static int _mem_node_data_offset = makeMemNodeDataOffset();
/*
{}
mem_node::~mem_node()
-{
- store_mem_size -= nodeBuffer.length;
-}
+{}
size_t
mem_node::InUseCount()
return Pool().inUseCount();
}
+size_t
+mem_node::StoreMemSize()
+{
+ return InUseCount() * SM_PAGE_SIZE;
+}
+
int64_t
mem_node::start() const
{
/*
- * $Id: mem_node.h,v 1.10 2007/08/13 17:20:51 hno Exp $
+ * $Id: mem_node.h,v 1.11 2007/12/27 01:58:19 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
public:
static size_t InUseCount();
- static unsigned long store_mem_size; /* 0 */
+ static size_t StoreMemSize();
MEMPROXY_CLASS(mem_node);
mem_node(int64_t);
/*
- * $Id: snmp_agent.cc,v 1.97 2007/12/14 23:11:48 amosjeffries Exp $
+ * $Id: snmp_agent.cc,v 1.98 2007/12/27 01:58:19 hno Exp $
*
* DEBUG: section 49 SNMP Interface
* AUTHOR: Kostas Anagnostakis
case SYSVMSIZ:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- mem_node::store_mem_size >> 10,
+ mem_node::StoreMemSize() >> 10,
ASN_INTEGER);
break;
/*
- * $Id: stat.cc,v 1.411 2007/12/14 23:11:48 amosjeffries Exp $
+ * $Id: stat.cc,v 1.412 2007/12/27 01:58:19 hno Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "\tStorage Mem size:\t%d KB\n",
- (int) (mem_node::store_mem_size >> 10));
+ mem_node::StoreMemSize() >> 10);
storeAppendPrintf(sentry, "\tStorage Mem capacity:\t%4.1f%% used, %4.1f%% free\n",
dpercent(mem_node::InUseCount(), store_pages_max),
/*
- * $Id: stmem.cc,v 1.92 2007/08/13 18:25:14 hno Exp $
+ * $Id: stmem.cc,v 1.93 2007/12/27 01:58:19 hno Exp $
*
* DEBUG: section 19 Store Memory Primitives
* AUTHOR: Harvest Derived
/* Adjust the ptr and len according to what was deposited in the page */
aNode->nodeBuffer.length += copyLen;
- mem_node::store_mem_size += copyLen;
-
return copyLen;
}