MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cache_bucket_pop

Function cache_bucket_pop

freebsd/vm/uma_core.c:742–758  ·  view source on GitHub ↗

Pops an item out of a per-cpu cache bucket. */

Source from the content-addressed store, hash-verified

740
741/* Pops an item out of a per-cpu cache bucket. */
742static inline void *
743cache_bucket_pop(uma_cache_t cache, uma_cache_bucket_t bucket)
744{
745 void *item;
746
747 CRITICAL_ASSERT(curthread);
748
749 bucket->ucb_cnt--;
750 item = bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt];
751#ifdef INVARIANTS
752 bucket->ucb_bucket->ub_bucket[bucket->ucb_cnt] = NULL;
753 KASSERT(item != NULL, ("uma_zalloc: Bucket pointer mangled."));
754#endif
755 cache->uc_allocs++;
756
757 return (item);
758}
759
760/* Pushes an item into a per-cpu cache bucket. */
761static inline void

Callers 1

cache_alloc_itemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected