| 1200 | SYSINIT(kmem, SI_SUB_KMEM, SI_ORDER_SECOND, mallocinit, NULL); |
| 1201 | |
| 1202 | void |
| 1203 | malloc_init(void *data) |
| 1204 | { |
| 1205 | struct malloc_type_internal *mtip; |
| 1206 | struct malloc_type *mtp; |
| 1207 | |
| 1208 | KASSERT(vm_cnt.v_page_count != 0, ("malloc_register before vm_init")); |
| 1209 | |
| 1210 | mtp = data; |
| 1211 | if (mtp->ks_version != M_VERSION) |
| 1212 | panic("malloc_init: type %s with unsupported version %lu", |
| 1213 | mtp->ks_shortdesc, mtp->ks_version); |
| 1214 | |
| 1215 | mtip = &mtp->ks_mti; |
| 1216 | mtip->mti_stats = uma_zalloc_pcpu(pcpu_zone_64, M_WAITOK | M_ZERO); |
| 1217 | mtp_set_subzone(mtp); |
| 1218 | |
| 1219 | mtx_lock(&malloc_mtx); |
| 1220 | mtp->ks_next = kmemstatistics; |
| 1221 | kmemstatistics = mtp; |
| 1222 | kmemcount++; |
| 1223 | mtx_unlock(&malloc_mtx); |
| 1224 | } |
| 1225 | |
| 1226 | void |
| 1227 | malloc_uninit(void *data) |
nothing calls this directly
no test coverage detected