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

Function kobj_delete

freebsd/kern/subr_kobj.c:329–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void
330kobj_delete(kobj_t obj, struct malloc_type *mtype)
331{
332 kobj_class_t cls = obj->ops->cls;
333 int refs;
334
335 /*
336 * Consider freeing the compiled method table for the class
337 * after its last instance is deleted. As an optimisation, we
338 * should defer this for a short while to avoid thrashing.
339 */
340 KOBJ_ASSERT(MA_NOTOWNED);
341 KOBJ_LOCK();
342 cls->refs--;
343 refs = cls->refs;
344 KOBJ_UNLOCK();
345
346 if (!refs)
347 kobj_class_free(cls);
348
349 obj->ops = NULL;
350 if (mtype)
351 free(obj, mtype);
352}

Callers 8

iconv_xlat_closeFunction · 0.85
iconv_ucs_closeFunction · 0.85
iconv_xlat16_closeFunction · 0.85
make_deviceFunction · 0.85
device_delete_childFunction · 0.85
device_set_driverFunction · 0.85
linker_file_unloadFunction · 0.85
iflib_deregisterFunction · 0.85

Calls 2

kobj_class_freeFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected