1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Slab allocator can free the blocks without knowing the parent structure

This commit is contained in:
Maria Matejka
2022-04-04 20:31:14 +02:00
parent 3a6eda995e
commit ebd807c0b8
13 changed files with 128 additions and 125 deletions

View File

@@ -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);
}
/**

View File

@@ -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 *

View File

@@ -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);

View File

@@ -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)