summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-04-04 20:31:14 +0200
committerMaria Matejka <mq@ucw.cz>2022-04-06 18:14:08 +0200
commitebd807c0b8eb0b7a3dc3371cd4c87ae886c00885 (patch)
tree28e6a621b8e3fddec46381046a15ffcda4f7e246 /nest
parent3a6eda995ecfcebff3130d86ee3baeab12a41335 (diff)
Slab allocator can free the blocks without knowing the parent structure
Diffstat (limited to 'nest')
-rw-r--r--nest/neighbor.c2
-rw-r--r--nest/rt-attr.c6
-rw-r--r--nest/rt-fib.c2
-rw-r--r--nest/rt-table.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c
index 1a31fb79..7cf9c85d 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -345,7 +345,7 @@ neigh_free(neighbor *n)
{
rem_node(&n->n);
rem_node(&n->if_n);
- sl_free(neigh_slab, n);
+ sl_free(n);
}
/**
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 1bece201..863d411b 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -154,7 +154,7 @@ rt_prune_sources(void)
{
HASH_DO_REMOVE(src_hash, RSH, sp);
idm_free(&src_ids, src->global_id);
- sl_free(rte_src_slab, src);
+ sl_free(src);
}
}
HASH_WALK_FILTER_END;
@@ -391,7 +391,7 @@ nexthop_free(struct nexthop *o)
while (o)
{
n = o->next;
- sl_free(nexthop_slab(o), o);
+ sl_free(o);
o = n;
}
}
@@ -1231,7 +1231,7 @@ rta__free(rta *a)
nexthop_free(a->nh.next);
ea_free(a->eattrs);
a->cached = 0;
- sl_free(rta_slab(a), a);
+ sl_free(a);
}
rta *
diff --git a/nest/rt-fib.c b/nest/rt-fib.c
index 1690a8f6..43e3039d 100644
--- a/nest/rt-fib.c
+++ b/nest/rt-fib.c
@@ -475,7 +475,7 @@ fib_delete(struct fib *f, void *E)
}
if (f->fib_slab)
- sl_free(f->fib_slab, E);
+ sl_free(E);
else
mb_free(E);
diff --git a/nest/rt-table.c b/nest/rt-table.c
index a1e49c21..1885e602 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -631,7 +631,7 @@ rte_free(rte *e)
rt_unlock_source(e->src);
if (rta_is_cached(e->attrs))
rta_free(e->attrs);
- sl_free(rte_slab, e);
+ sl_free(e);
}
static inline void
@@ -639,7 +639,7 @@ rte_free_quick(rte *e)
{
rt_unlock_source(e->src);
rta_free(e->attrs);
- sl_free(rte_slab, e);
+ sl_free(e);
}
static int /* Actually better or at least as good as */
@@ -3393,7 +3393,7 @@ hc_delete_hostentry(struct hostcache *hc, pool *p, struct hostentry *he)
rem_node(&he->ln);
hc_remove(hc, he);
- sl_free(hc->slab, he);
+ sl_free(he);
hc->hash_items--;
if (hc->hash_items < hc->hash_min)