- /* Allocate name cache lock group attribute and group */
- namecache_lck_grp_attr = lck_grp_attr_alloc_init();
-
- namecache_lck_grp = lck_grp_alloc_init("Name Cache", namecache_lck_grp_attr);
-
- /* Allocate name cache lock attribute */
- namecache_lck_attr = lck_attr_alloc_init();
-
- /* Allocate name cache lock */
- namecache_rw_lock = lck_rw_alloc_init(namecache_lck_grp, namecache_lck_attr);
-
-
- /* Allocate string cache lock group attribute and group */
- strcache_lck_grp_attr = lck_grp_attr_alloc_init();
-
- strcache_lck_grp = lck_grp_alloc_init("String Cache", strcache_lck_grp_attr);
-
- /* Allocate string cache lock attribute */
- strcache_lck_attr = lck_attr_alloc_init();
-
- /* Allocate string cache lock */
- strtable_rw_lock = lck_rw_alloc_init(strcache_lck_grp, strcache_lck_attr);
-
- for (i = 0; i < NUM_STRCACHE_LOCKS; i++) {
- lck_mtx_init(&strcache_mtx_locks[i], strcache_lck_grp, strcache_lck_attr);
+ for (int i = 0; i < NUM_STRCACHE_LOCKS; i++) {
+ lck_mtx_init(&strcache_mtx_locks[i], &strcache_lck_grp, &strcache_lck_attr);