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

Function kobj_class_compile_common

freebsd/kern/subr_kobj.c:100–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static void
101kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops)
102{
103 kobj_method_t *m;
104 int i;
105
106 /*
107 * Don't do anything if we are already compiled.
108 */
109 if (cls->ops)
110 return;
111
112 /*
113 * First register any methods which need it.
114 */
115 for (i = 0, m = cls->methods; m->desc; i++, m++) {
116 if (m->desc->id == 0)
117 m->desc->id = kobj_next_id++;
118 }
119
120 /*
121 * Then initialise the ops table.
122 */
123 for (i = 0; i < KOBJ_CACHE_SIZE; i++)
124 ops->cache[i] = &null_method;
125 ops->cls = cls;
126 cls->ops = ops;
127}
128
129static int
130kobj_class_compile1(kobj_class_t cls, int mflags)

Callers 2

kobj_class_compile1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected