Loading...
--- libmalloc/libmalloc-657.80.3/tests/malloc_heap_check_test.c
+++ libmalloc/libmalloc-283.60.1/tests/malloc_heap_check_test.c
@@ -7,18 +7,18 @@
#include <stdlib.h>
#include <darwintest.h>
-T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true), T_META_TAG_XZONE, T_META_TAG_VM_NOT_PREFERRED);
+T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
static void
-run_heap_test(int iterations)
+run_heap_test()
{
const int MAX_POINTERS = 1024;
void **pointers = (void **)calloc(MAX_POINTERS, sizeof(void *));
- for (int iteration = 0; iteration < iterations; iteration++) {
- int index = rand() % MAX_POINTERS;
- size_t size = 1 << (rand() % 20);
+ for (int iteration = 0; iteration < 100000; iteration++) {
+ int index = random() % MAX_POINTERS;
+ size_t size = 1 << (random() % 20);
if (pointers[index]) {
- if (rand() % 4 == 0) {
+ if (random() % 4 == 0) {
pointers[index] = realloc(pointers[index], size);
continue;
}
@@ -41,7 +41,7 @@
T_META_ENVVAR("MallocCheckHeapEach=1"),
T_META_ENVVAR("MallocNanoZone=0"))
{
- run_heap_test(100000);
+ run_heap_test();
// If we get here without crashing, we pass.
T_PASS("Heap check succeeded");
@@ -51,17 +51,9 @@
T_META_ENVVAR("MallocCheckHeapEach=1"),
T_META_ENVVAR("MallocNanoZone=1"))
{
- run_heap_test(100000);
+ run_heap_test();
// If we get here without crashing, we pass.
T_PASS("Heap check succeeded");
}
-T_DECL(malloc_simple_stack_logging, "Test MallocSimpleStackLogging=1",
- T_META_ENVVAR("MallocSimpleStackLogging=1"))
-{
- run_heap_test(1000);
-
- T_PASS("Success");
-}
-