Loading...
--- libmalloc/libmalloc-166.251.2/tests/nano_tests.c
+++ libmalloc/libmalloc-374.40.6/tests/nano_tests.c
@@ -85,6 +85,8 @@
static void *allocations[ALLOCATION_COUNT];
+T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
+
T_DECL(nano_active_test, "Test that Nano is activated",
T_META_ENVVAR("MallocNanoZone=1"))
{
@@ -317,7 +319,8 @@
#define ALLOCS_PER_ARENA ((NANOV2_ARENA_SIZE)/256)
T_DECL(overspill_arena, "force overspill of an arena",
- T_META_ENVVAR("MallocNanoZone=V2"))
+ T_META_ENVVAR("MallocNanoZone=V2"),
+ T_META_ENVVAR("MallocGuardEdges=all"))
{
#if CONFIG_NANOZONE
void **ptrs = calloc(ALLOCS_PER_ARENA, sizeof(void *));
@@ -339,6 +342,10 @@
if (current_ptr.fields.nano_arena != first_ptr.fields.nano_arena) {
break;
}
+
+ // Write to the pointer to ensure the containing block is not
+ // a guard block.
+ *(int *)ptrs[index] = 0;
}
// Free everything, which is a check that the book-keeping works across