Skip to content

Instantly share code, notes, and snippets.

@holmeshe
Created September 16, 2018 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holmeshe/03ff82e8025f55c14ec0c03585322fae to your computer and use it in GitHub Desktop.
Save holmeshe/03ff82e8025f55c14ec0c03585322fae to your computer and use it in GitHub Desktop.
typedef struct {
unsigned int size; /* sizes of items */
unsigned int perslab; /* how many items per slab */
void *slots; /* list of item ptrs */
unsigned int sl_curr; /* total free items in list */
unsigned int slabs; /* how many slabs were allocated for this class */
void **slab_list; /* array of slab pointers */
unsigned int list_size; /* size of prev array */
size_t requested; /* The number of requested bytes */
} slabclass_t;
static slabclass_t slabclass[MAX_NUMBER_OF_SLAB_CLASSES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment