aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2019-08-19 14:43:14 +0200
committerMaria Matejka <mq@ucw.cz>2020-05-01 15:19:12 +0200
commit59238768b3b05fa134348d2232b42537d0403994 (patch)
tree2f89f2ebb64189a3bd3410b9260e84a3c9322a61 /lib
parentea259d6201973eb0f764cbb2bb6549b6ac79b316 (diff)
downloadbird-59238768b3b05fa134348d2232b42537d0403994.tar.gz
Slab: Init node in slab head to NULLs.
Diffstat (limited to 'lib')
-rw-r--r--lib/slab.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/slab.c b/lib/slab.c
index 5c414f9e..c3035b45 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -216,8 +216,11 @@ sl_new_head(slab *s)
struct sl_obj *no;
uint n = s->objs_per_slab;
- h->first_free = o;
- h->num_full = 0;
+ *h = (struct sl_head) {
+ .first_free = o,
+ .num_full = 0,
+ };
+
while (n--)
{
o->slab = h;