]> git.saurik.com Git - apple/xnu.git/blobdiff - tests/verify_kalloc_config.c
xnu-6153.11.26.tar.gz
[apple/xnu.git] / tests / verify_kalloc_config.c
index 14ce3c974958172f35e5530df5519a1dad06e173..2c5c08727f420f4951b48e99f7c026d4e5fa7f52 100644 (file)
@@ -6,12 +6,14 @@
 
 T_GLOBAL_META(
        T_META_NAMESPACE("xnu.vm"),
-       T_META_CHECK_LEAKS(false)
-);
+       T_META_CHECK_LEAKS(false),
+       T_META_RUN_CONCURRENTLY(true)
+       );
 
 static void run_test(void);
 
-static void run_test(void)
+static void
+run_test(void)
 {
        kern_return_t kr;
        uint64_t size, i;
@@ -24,8 +26,8 @@ static void run_test(void)
        const char kalloc_str[] = "kalloc.";
 
        kr = mach_memory_info(mach_host_self(),
-                       &name, &nameCnt, &info, &infoCnt,
-                       &wiredInfo, &wiredInfoCnt);
+           &name, &nameCnt, &info, &infoCnt,
+           &wiredInfo, &wiredInfoCnt);
        T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_memory_info");
        T_QUIET; T_ASSERT_EQ(nameCnt, infoCnt, "zone name and info counts don't match");
 
@@ -40,19 +42,19 @@ static void run_test(void)
 
        if ((name != NULL) && (nameCnt != 0)) {
                kr = vm_deallocate(mach_task_self(), (vm_address_t) name,
-                               (vm_size_t) (nameCnt * sizeof *name));
+                   (vm_size_t) (nameCnt * sizeof *name));
                T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate name");
        }
 
        if ((info != NULL) && (infoCnt != 0)) {
                kr = vm_deallocate(mach_task_self(), (vm_address_t) info,
-                               (vm_size_t) (infoCnt * sizeof *info));
+                   (vm_size_t) (infoCnt * sizeof *info));
                T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate info");
        }
 
        if ((wiredInfo != NULL) && (wiredInfoCnt != 0)) {
                kr = vm_deallocate(mach_task_self(), (vm_address_t) wiredInfo,
-                               (vm_size_t) (wiredInfoCnt * sizeof *wiredInfo));
+                   (vm_size_t) (wiredInfoCnt * sizeof *wiredInfo));
                T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "vm_deallocate wiredInfo");
        }
 
@@ -60,9 +62,8 @@ static void run_test(void)
 }
 
 T_DECL( verify_kalloc_config,
-               "verifies that the kalloc zones are configured correctly",
-               T_META_ASROOT(true))
+    "verifies that the kalloc zones are configured correctly",
+    T_META_ASROOT(true))
 {
        run_test();
 }
-