Skip to content

Instantly share code, notes, and snippets.

@holmeshe
Created September 20, 2018 09:05
Show Gist options
  • Select an option

  • Save holmeshe/e8766723dd3e870f0d1fc543266971d0 to your computer and use it in GitHub Desktop.

Select an option

Save holmeshe/e8766723dd3e870f0d1fc543266971d0 to your computer and use it in GitHub Desktop.
static void do_slabs_free(void *ptr, const size_t size, unsigned int id) {
slabclass_t *p;
item *it;
...
p = &slabclass[id];
it = (item *)ptr;
it->it_flags = ITEM_SLABBED; // scr: ---------------> 1)
it->slabs_clsid = 0;
it->prev = 0; // scr: ------------------------------> 2)
it->next = p->slots;
if (it->next) it->next->prev = it;
p->slots = it;
p->sl_curr++; // scr: ------------------------------> 3)
p->requested -= size;
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment