Loading...
--- libmalloc/libmalloc-317.140.5/tests/magazine_tiny_test.c
+++ libmalloc/libmalloc-283/tests/magazine_tiny_test.c
@@ -11,21 +11,20 @@
#include "../src/magazine_tiny.c"
#include "magazine_testing.h"
-// Stubs
-bool aggressive_madvise_enabled = DEFAULT_AGGRESSIVE_MADVISE_ENABLED;
-
T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
static inline void
-tiny_test_rack_setup(rack_t *rack)
+test_rack_setup(rack_t *rack)
{
- test_rack_setup(rack, RACK_TYPE_TINY);
+ memset(rack, 'a', sizeof(rack));
+ rack_init(rack, RACK_TYPE_TINY, 1, 0);
+ T_QUIET; T_ASSERT_NOTNULL(rack->magazines, "magazine initialisation");
}
T_DECL(basic_tiny_alloc, "tiny rack init and alloc")
{
struct rack_s rack;
- tiny_test_rack_setup(&rack);
+ test_rack_setup(&rack);
void *ptr = tiny_malloc_should_clear(&rack, TINY_MSIZE_FOR_BYTES(32), false);
T_ASSERT_NOTNULL(ptr, "allocation");
@@ -40,7 +39,7 @@
T_DECL(basic_tiny_teardown, "tiny rack init, alloc, teardown")
{
struct rack_s rack;
- tiny_test_rack_setup(&rack);
+ test_rack_setup(&rack);
void *ptr = tiny_malloc_should_clear(&rack, TINY_MSIZE_FOR_BYTES(32), false);
T_ASSERT_NOTNULL(ptr, "allocation");
@@ -60,7 +59,7 @@
T_DECL(basic_tiny_free, "tiny free")
{
struct rack_s rack;
- tiny_test_rack_setup(&rack);
+ test_rack_setup(&rack);
void *ptr = tiny_malloc_should_clear(&rack, TINY_MSIZE_FOR_BYTES(32), false);
T_ASSERT_NOTNULL(ptr, "allocation");
@@ -75,7 +74,7 @@
T_DECL(basic_tiny_shrink, "tiny rack shrink")
{
struct rack_s rack;
- tiny_test_rack_setup(&rack);
+ test_rack_setup(&rack);
void *ptr = tiny_malloc_should_clear(&rack, TINY_MSIZE_FOR_BYTES(64), false);
T_ASSERT_NOTNULL(ptr, "allocation");
@@ -92,7 +91,7 @@
T_DECL(basic_tiny_realloc_in_place, "tiny rack realloc in place")
{
struct rack_s rack;
- tiny_test_rack_setup(&rack);
+ test_rack_setup(&rack);
// Allocate two blocks and free the second, then try to realloc() the first.
// This should extend in-place using the one-level death row cache that's