/*
- * $Id: store_repl_lru.cc,v 1.22 2007/04/25 11:30:19 adrian Exp $
- *
* DEBUG: none LRU Removal Policy
* AUTHOR: Henrik Nordstrom
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*/
#include "squid.h"
-#include "Store.h"
#include "MemObject.h"
#include "SquidTime.h"
+#include "Store.h"
REMOVALPOLICYCREATE createRemovalPolicy_lru;
-struct LruPolicyData
-{
+struct LruPolicyData {
void setPolicyNode (StoreEntry *, void *) const;
RemovalPolicy *policy;
dlink_list list;
typedef struct _LruNode LruNode;
-struct _LruNode
-{
+struct _LruNode {
/* Note: the dlink_node MUST be the first member of the LruNode
* structure. This member is later pointer typecasted to LruNode *.
*/
dlinkDelete(&lru_node->node, &lru->list);
- lru_node_pool->free(lru_node);
+ lru_node_pool->freeOne(lru_node);
lru->count -= 1;
}
typedef struct _LruWalkData LruWalkData;
-struct _LruWalkData
-{
+struct _LruWalkData {
LruNode *current;
};
typedef struct _LruPurgeData LruPurgeData;
-struct _LruPurgeData
-{
+struct _LruPurgeData {
LruNode *current;
LruNode *start;
};
if (entry->locked()) {
/* Shit, it is locked. we can't return this one */
- walker->locked++;
+ ++ walker->locked;
dlinkAddTail(entry, &lru_node->node, &lru->list);
goto try_again;
}
- lru_node_pool->free(lru_node);
+ lru_node_pool->freeOne(lru_node);
lru->count -= 1;
lru->setPolicyNode(entry, NULL);
return entry;