Lines Matching refs:slab
274 rtl_cache_slab_type * slab = (rtl_cache_slab_type*)(obj); in rtl_cache_slab_constructor() local
278 QUEUE_START_NAMED(slab, slab_); in rtl_cache_slab_constructor()
279 slab->m_ntypes = 0; in rtl_cache_slab_constructor()
293 rtl_cache_slab_type * slab = (rtl_cache_slab_type*)(obj); in rtl_cache_slab_destructor()
296 OSL_ASSERT(QUEUE_STARTED_NAMED(slab, slab_)); in rtl_cache_slab_destructor()
299 OSL_ASSERT(slab->m_ntypes == 0); in rtl_cache_slab_destructor()
315 rtl_cache_slab_type * slab = NULL; in rtl_cache_slab_create() local
329 slab = (rtl_cache_slab_type*)rtl_cache_alloc (gp_cache_slab_cache); in rtl_cache_slab_create()
334 slab = RTL_CACHE_SLAB(addr, cache->m_slab_size); in rtl_cache_slab_create()
335 (void) rtl_cache_slab_constructor (slab, 0); in rtl_cache_slab_create()
337 if (slab != NULL) in rtl_cache_slab_create()
339 slab->m_data = (sal_uIntPtr)(addr); in rtl_cache_slab_create()
342 slab->m_bp = slab->m_data; in rtl_cache_slab_create()
343 slab->m_sp = NULL; in rtl_cache_slab_create()
350 return (slab); in rtl_cache_slab_create()
361 rtl_cache_slab_type * slab in rtl_cache_slab_destroy() argument
364 void * addr = (void*)(slab->m_data); in rtl_cache_slab_destroy()
365 sal_Size refcnt = slab->m_ntypes; slab->m_ntypes = 0; in rtl_cache_slab_destroy()
370 sal_Size ntypes = (slab->m_bp - slab->m_data) / cache->m_type_size; in rtl_cache_slab_destroy()
371 for (ntypes -= refcnt; slab->m_sp != NULL; ntypes--) in rtl_cache_slab_destroy()
373 rtl_cache_bufctl_type * bufctl = slab->m_sp; in rtl_cache_slab_destroy()
376 slab->m_sp = bufctl->m_next, bufctl->m_next = NULL; in rtl_cache_slab_destroy()
384 rtl_cache_free (gp_cache_slab_cache, slab); in rtl_cache_slab_destroy()
389 rtl_cache_slab_destructor (slab, 0); in rtl_cache_slab_destroy()
409 rtl_cache_slab_type * slab; in rtl_cache_slab_populate() local
412 slab = rtl_cache_slab_create (cache); in rtl_cache_slab_populate()
414 if (slab != NULL) in rtl_cache_slab_populate()
417 slab->m_bp += cache->m_ncolor; in rtl_cache_slab_populate()
428 QUEUE_INSERT_HEAD_NAMED(&(cache->m_free_head), slab, slab_); in rtl_cache_slab_populate()
430 return (slab != NULL); in rtl_cache_slab_populate()
452 rtl_cache_slab_type * slab; in rtl_cache_slab_alloc() local
455 slab = head->m_slab_next; in rtl_cache_slab_alloc()
456 OSL_ASSERT(slab->m_ntypes < cache->m_ntypes); in rtl_cache_slab_alloc()
458 if (slab->m_sp == NULL) in rtl_cache_slab_alloc()
461 …OSL_ASSERT (slab->m_bp < slab->m_data + cache->m_ntypes * cache->m_type_size + cache->m_ncolor_max… in rtl_cache_slab_alloc()
474 bufctl->m_addr = slab->m_bp; in rtl_cache_slab_alloc()
475 bufctl->m_slab = (sal_uIntPtr)(slab); in rtl_cache_slab_alloc()
480 bufctl = (rtl_cache_bufctl_type*)(slab->m_bp); in rtl_cache_slab_alloc()
485 slab->m_bp += cache->m_type_size; in rtl_cache_slab_alloc()
488 slab->m_sp = bufctl; in rtl_cache_slab_alloc()
492 bufctl = slab->m_sp; in rtl_cache_slab_alloc()
493 slab->m_sp = bufctl->m_next; in rtl_cache_slab_alloc()
496 if ((slab->m_ntypes += 1) == cache->m_ntypes) in rtl_cache_slab_alloc()
499 QUEUE_REMOVE_NAMED(slab, slab_); in rtl_cache_slab_alloc()
502 QUEUE_INSERT_TAIL_NAMED(&(cache->m_used_head), slab, slab_); in rtl_cache_slab_alloc()
535 rtl_cache_slab_type * slab; in rtl_cache_slab_free() local
548 slab = (bufctl != NULL) ? (rtl_cache_slab_type*)(bufctl->m_slab) : 0; in rtl_cache_slab_free()
554 slab = RTL_CACHE_SLAB(addr, cache->m_slab_size); in rtl_cache_slab_free()
557 if (slab != NULL) in rtl_cache_slab_free()
560 if (slab->m_ntypes == cache->m_ntypes) in rtl_cache_slab_free()
563 QUEUE_REMOVE_NAMED(slab, slab_); in rtl_cache_slab_free()
566 QUEUE_INSERT_HEAD_NAMED(&(cache->m_free_head), slab, slab_); in rtl_cache_slab_free()
570 bufctl->m_next = slab->m_sp; in rtl_cache_slab_free()
571 slab->m_sp = bufctl; in rtl_cache_slab_free()
578 if ((slab->m_ntypes -= 1) == 0) in rtl_cache_slab_free()
581 QUEUE_REMOVE_NAMED(slab, slab_); in rtl_cache_slab_free()
588 rtl_cache_slab_destroy (cache, slab); in rtl_cache_slab_free()
1080 rtl_cache_slab_type *head, *slab; in rtl_cache_deactivate() local
1083 for (slab = head->m_slab_next; slab != head; slab = head->m_slab_next) in rtl_cache_deactivate()
1086 QUEUE_REMOVE_NAMED(slab, slab_); in rtl_cache_deactivate()
1092 rtl_cache_slab_destroy (cache, slab); in rtl_cache_deactivate()
1096 for (slab = head->m_slab_next; slab != head; slab = head->m_slab_next) in rtl_cache_deactivate()
1099 QUEUE_REMOVE_NAMED(slab, slab_); in rtl_cache_deactivate()
1105 rtl_cache_slab_destroy (cache, slab); in rtl_cache_deactivate()