Lines Matching refs:npages
216 void *rt_slab_page_alloc(rt_slab_t m, rt_size_t npages) in rt_slab_page_alloc() argument
222 if (npages == 0) in rt_slab_page_alloc()
227 if (b->page > npages) in rt_slab_page_alloc()
230 n = b + npages; in rt_slab_page_alloc()
232 n->page = b->page - npages; in rt_slab_page_alloc()
237 if (b->page == npages) in rt_slab_page_alloc()
257 void rt_slab_page_free(rt_slab_t m, void *addr, rt_size_t npages) in rt_slab_page_free() argument
265 RT_ASSERT(npages != 0); in rt_slab_page_free()
276 if (b + (b->page += npages) == b->next) in rt_slab_page_free()
284 if (b == n + npages) in rt_slab_page_free()
286 n->page = b->page + npages; in rt_slab_page_free()
292 if (b > n + npages) in rt_slab_page_free()
296 n->page = npages; in rt_slab_page_free()
304 static void rt_slab_page_init(struct rt_slab *slab, void *addr, rt_size_t npages) in rt_slab_page_init() argument
307 RT_ASSERT(npages != 0); in rt_slab_page_init()
310 rt_slab_page_free((rt_slab_t)(&slab->parent), addr, npages); in rt_slab_page_init()
326 rt_uint32_t limsize, npages; in rt_slab_init() local
343 npages = limsize / RT_MM_PAGE_SIZE; in rt_slab_init()
345 begin_align, end_align, limsize, npages); in rt_slab_init()
359 rt_slab_page_init(slab, (void *)slab->heap_start, npages); in rt_slab_init()
376 limsize = npages * sizeof(struct rt_slab_memusage); in rt_slab_init()