Loading...
--- libmalloc/libmalloc-646.0.13/tests/pgm_zone_api.c
+++ libmalloc/libmalloc-521.120.7/tests/pgm_zone_api.c
@@ -63,25 +63,15 @@
wrapped_zone.calloc = NULL;
}
-T_DECL(optional_apis, "Restrict zone API to what is supported by wrapped zone", T_META_TAG_VM_PREFERRED)
+T_DECL(optional_apis, "Restrict zone API to what is supported by wrapped zone")
{
setup();
malloc_zone_t *z = &zone->malloc_zone;
-
- // Always supported
- T_EXPECT_NOTNULL(z->batch_malloc, NULL);
- T_EXPECT_NOTNULL(z->batch_free, NULL);
- T_EXPECT_NOTNULL(z->pressure_relief, NULL);
- T_EXPECT_NOTNULL(z->malloc_with_options, NULL);
-
- // Never supported
- T_EXPECT_NULL(z->try_free_default, NULL);
-
- // Supported if wrapped zone has it
- T_EXPECT_NULL(z->memalign, NULL);
- T_EXPECT_NULL(z->free_definite_size, NULL);
- T_EXPECT_NULL(z->claimed_address, NULL);
+ T_EXPECT_NOTNULL(z->batch_malloc, "batch_malloc() is always supported");
+ T_EXPECT_NOTNULL(z->batch_free, "batch_free() is always supported");
+ T_EXPECT_NULL(z->memalign, "memalign() is optional");
+ T_EXPECT_NULL(z->free_definite_size, "free_definite_size() is optional");
}
static size_t wrapped_zone_malloc_expected_size = size;
@@ -94,8 +84,7 @@
}
T_DECL(delegate_unsampled, "delegation of unsampled allocations",
- T_META_ENVVAR("MallocProbGuardAllocations=1"),
- T_META_TAG_VM_PREFERRED)
+ T_META_ENVVAR("MallocProbGuardAllocations=1"))
{
setup();
wrapped_zone.malloc = wrapped_zone_malloc;
@@ -126,7 +115,7 @@
wrapped_zone_free_call_count++;
}
-T_DECL(delegate_unguarded, "delegation of unguarded deallocations", T_META_TAG_VM_PREFERRED)
+T_DECL(delegate_unguarded, "delegation of unguarded deallocations")
{
setup();
wrapped_zone.free = wrapped_zone_free;
@@ -144,7 +133,7 @@
T_EXPECT_EQ(wrapped_zone_free_call_count, 1, "delegate unguarded");
}
-T_DECL(size, "size is rounded up to multiple of 16", T_META_TAG_VM_PREFERRED)
+T_DECL(size, "size is rounded up to multiple of 16")
{
setup();
size_t requested_sizes[] = {0, 1, 16, 17, 32, 33, 48, 49};
@@ -164,7 +153,7 @@
return ((uintptr_t)ptr % alignment) == 0;
}
-T_DECL(alignment, "alignments", T_META_TAG_VM_PREFERRED)
+T_DECL(alignment, "alignments")
{
wrapped_zone.memalign = malloc_default_zone()->memalign;
setup();
@@ -185,7 +174,7 @@
return ++wrapped_zone_memalign_ret_value;
}
-T_DECL(memalign_invalid_alignment, "memalign delegates for invalid alignment", T_META_TAG_VM_PREFERRED)
+T_DECL(memalign_invalid_alignment, "memalign delegates for invalid alignment")
{
wrapped_zone.memalign = wrapped_zone_memalign;
setup();
@@ -201,7 +190,7 @@
return (void *)7;
}
-T_DECL(calloc_overflow, "calloc delegates on overflow", T_META_TAG_VM_PREFERRED)
+T_DECL(calloc_overflow, "calloc delegates on overflow")
{
setup();
wrapped_zone.calloc = wrapped_zone_calloc;
@@ -226,8 +215,7 @@
T_DECL(calloc_zeroed_memory, "calloc provides zeroed memory",
T_META_ENVVAR("MallocProbGuardSlots=2"),
T_META_ENVVAR("MallocProbGuardMetadata=2"),
- T_META_ENVVAR("MallocProbGuardAllocations=1"),
- T_META_TAG_VM_PREFERRED)
+ T_META_ENVVAR("MallocProbGuardAllocations=1"))
{
setup();
@@ -246,7 +234,7 @@
T_EXPECT_TRUE(is_zeroed_page(ptr3), "zeroed page");
}
-T_DECL(realloc_null_pointer, "realloc forwards to malloc for null pointers", T_META_TAG_VM_PREFERRED)
+T_DECL(realloc_null_pointer, "realloc forwards to malloc for null pointers")
{
setup();
wrapped_zone.malloc = wrapped_zone_malloc;
@@ -262,8 +250,7 @@
return (void *)9;
}
-T_DECL(realloc_unguarded_and_unsampled, "realloc only delegates for old-unguarded and new-unsampled combination",
- T_META_TAG_VM_PREFERRED)
+T_DECL(realloc_unguarded_and_unsampled, "realloc only delegates for old-unguarded and new-unsampled combination")
{
setup();
wrapped_zone.realloc = wrapped_zone_realloc;
@@ -273,8 +260,7 @@
}
T_DECL(batch_malloc, "batch_malloc implementation",
- T_META_ENVVAR("MallocProbGuardAllocations=2"),
- T_META_TAG_VM_PREFERRED)
+ T_META_ENVVAR("MallocProbGuardAllocations=2"))
{
setup();
wrapped_zone.malloc = wrapped_zone_malloc;
@@ -291,7 +277,7 @@
T_EXPECT_EQ(results[2], (void *)1, "Wrapped zone allocation");
}
-T_DECL(batch_free, "batch_free implementation", T_META_TAG_VM_PREFERRED)
+T_DECL(batch_free, "batch_free implementation")
{
setup();
wrapped_zone.free = wrapped_zone_free;
@@ -323,7 +309,7 @@
T_QUIET; T_EXPECT_EQ(count, 1, NULL);
}
-T_DECL(introspection_enumerator, "In-process block enumeration", T_META_TAG_VM_PREFERRED)
+T_DECL(introspection_enumerator, "In-process block enumeration")
{
setup();
expected_ranges[0] = (vm_range_t){(vm_address_t)CALL(malloc, 7), 16};