• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/barrelfish/

Lines Matching defs:slabs

6  * size from a pool of contiguous memory regions ("slabs").
31 * \param slabs Pointer to slab allocator instance, to be filled-in
35 void slab_init(struct slab_allocator *slabs, size_t blocksize,
38 slabs->slabs = NULL;
39 slabs->blocksize = SLAB_REAL_BLOCKSIZE(blocksize);
40 slabs->refill_func = refill_func;
47 * \param slabs Pointer to slab allocator instance
51 void slab_grow(struct slab_allocator *slabs, void *buf, size_t buflen)
60 size_t blocksize = slabs->blocksize;
74 /* enqueue slab in list of slabs */
75 head->next = slabs->slabs;
76 slabs->slabs = head;
82 * \param slabs Pointer to slab allocator instance
86 void *slab_alloc(struct slab_allocator *slabs)
91 for (sh = slabs->slabs; sh != NULL && sh->free == 0; sh = sh->next);
95 if (!slabs->refill_func) {
98 err = slabs->refill_func(slabs);
103 for (sh = slabs->slabs; sh != NULL && sh->free == 0; sh = sh->next);
122 * \param slabs Pointer to slab allocator instance
125 void slab_free(struct slab_allocator *slabs, void *block)
135 size_t blocksize = slabs->blocksize;
136 for (sh = slabs->slabs; sh != NULL; sh = sh->next) {
156 * \param slabs Pointer to slab allocator instance
160 size_t slab_freecount(struct slab_allocator *slabs)
164 for (struct slab_head *sh = slabs->slabs; sh != NULL; sh = sh->next) {
176 * \param slabs Pointer to slab allocator instance
179 static errval_t slab_refill_pages(struct slab_allocator *slabs, size_t bytes)
195 slab_grow(slabs, buf, bytes);
205 * \param slabs Pointer to slab allocator instance
207 errval_t slab_default_refill(struct slab_allocator *slabs)
209 return slab_refill_pages(slabs, BASE_PAGE_SIZE);