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

Function kobj_class_free

freebsd/kern/subr_kobj.c:232–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void
233kobj_class_free(kobj_class_t cls)
234{
235 void* ops = NULL;
236
237 KOBJ_ASSERT(MA_NOTOWNED);
238 KOBJ_LOCK();
239
240 /*
241 * Protect against a race between kobj_create and
242 * kobj_delete.
243 */
244 if (cls->refs == 0) {
245 /*
246 * For now we don't do anything to unregister any methods
247 * which are no longer used.
248 */
249
250 /*
251 * Free memory and clean up.
252 */
253 ops = cls->ops;
254 cls->ops = NULL;
255 }
256
257 KOBJ_UNLOCK();
258
259 if (ops)
260 free(ops, M_KOBJ);
261}
262
263static void
264kobj_init_common(kobj_t obj, kobj_class_t cls)

Callers 3

devclass_delete_driverFunction · 0.85
kobj_deleteFunction · 0.85

Calls 1

freeFunction · 0.70

Tested by

no test coverage detected