Created
September 20, 2018 09:01
-
-
Save holmeshe/000339099a3fadecba94b524e4851225 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int grow_slab_list (const unsigned int id) { | |
slabclass_t *p = &slabclass[id]; | |
if (p->slabs == p->list_size) { | |
size_t new_size = (p->list_size != 0) ? p->list_size * 2 : 16; | |
void *new_list = realloc(p->slab_list, new_size * sizeof(void *)); | |
if (new_list == 0) return 0; | |
p->list_size = new_size; | |
p->slab_list = new_list; | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment