Skip to content

Commit

Permalink
Slab: Init node in slab head to NULLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
marenamat committed May 1, 2020
1 parent ea259d6 commit 5923876
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5923876

Please sign in to comment.