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

Function vmem_destroy1

freebsd/kern/subr_vmem.c:876–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876static void
877vmem_destroy1(vmem_t *vm)
878{
879 bt_t *bt;
880
881 /*
882 * Drain per-cpu quantum caches.
883 */
884 qc_destroy(vm);
885
886 /*
887 * The vmem should now only contain empty segments.
888 */
889 VMEM_LOCK(vm);
890 MPASS(vm->vm_nbusytag == 0);
891
892 TAILQ_REMOVE(&vm->vm_seglist, &vm->vm_cursor, bt_seglist);
893 while ((bt = TAILQ_FIRST(&vm->vm_seglist)) != NULL)
894 bt_remseg(vm, bt);
895
896 if (vm->vm_hashlist != NULL && vm->vm_hashlist != vm->vm_hash0)
897 free(vm->vm_hashlist, M_VMEM);
898
899 bt_freetrim(vm, 0);
900
901 VMEM_CONDVAR_DESTROY(vm);
902 VMEM_LOCK_DESTROY(vm);
903 uma_zfree(vmem_zone, vm);
904}
905
906static int
907vmem_import(vmem_t *vm, vmem_size_t size, vmem_size_t align, int flags)

Callers 2

vmem_initFunction · 0.85
vmem_destroyFunction · 0.85

Calls 5

qc_destroyFunction · 0.85
bt_remsegFunction · 0.85
bt_freetrimFunction · 0.85
freeFunction · 0.70
uma_zfreeFunction · 0.50

Tested by

no test coverage detected