Hi,
lru64_lookup function was added in a previous patch of mine. This one
just remove a useless memory allocation.
Regards,
--
Christopher Faulet
>From 20f5030ea57bfd655af4879b5a7e3bc65c859fa3 Mon Sep 17 00:00:00 2001
From: Christopher Faulet <[email protected]>
Date: Tue, 28 Jul 2015 16:01:07 +0200
Subject: [PATCH] MINOR: lru: do not allocate useless memory in lru64_lookup
---
src/lru.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/src/lru.c b/src/lru.c
index 4a46505..719fe07 100644
--- a/src/lru.c
+++ b/src/lru.c
@@ -39,15 +39,6 @@ struct lru64 *lru64_lookup(unsigned long long key, struct lru64_head *lru,
struct eb64_node *node;
struct lru64 *elem;
- if (!lru->spare) {
- if (!lru->cache_size)
- return NULL;
- lru->spare = malloc(sizeof(*lru->spare));
- if (!lru->spare)
- return NULL;
- lru->spare->domain = NULL;
- }
-
node = __eb64_lookup(&lru->keys, key);
elem = container_of(node, typeof(*elem), node);
if (elem) {
--
2.4.3