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

Function keg_dtor

freebsd/vm/uma_core.c:2777–2798  ·  view source on GitHub ↗

* Keg header dtor. This frees all data, destroys locks, frees the hash * table and removes the keg from the global list. * * Arguments/Returns follow uma_dtor specifications * udata unused */

Source from the content-addressed store, hash-verified

2775 * udata unused
2776 */
2777static void
2778keg_dtor(void *arg, int size, void *udata)
2779{
2780 uma_keg_t keg;
2781 uint32_t free, pages;
2782 int i;
2783
2784 keg = (uma_keg_t)arg;
2785 free = pages = 0;
2786 for (i = 0; i < vm_ndomains; i++) {
2787 free += keg->uk_domain[i].ud_free_items;
2788 pages += keg->uk_domain[i].ud_pages;
2789 KEG_LOCK_FINI(keg, i);
2790 }
2791 if (pages != 0)
2792 printf("Freed UMA keg (%s) was not empty (%u items). "
2793 " Lost %u pages of memory.\n",
2794 keg->uk_name ? keg->uk_name : "",
2795 pages / keg->uk_ppera * keg->uk_ipers - free, pages);
2796
2797 hash_free(&keg->uk_hash);
2798}
2799
2800/*
2801 * Zone header dtor.

Callers

nothing calls this directly

Calls 2

hash_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected