From 2d3a573977417d917c16742d8d9d8ead047d0ebc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 May 2026 22:29:35 +0200 Subject: Misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libtest/globals.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 libtest/globals.c (limited to 'libtest/globals.c') diff --git a/libtest/globals.c b/libtest/globals.c new file mode 100644 index 0000000..9e9ec2f --- /dev/null +++ b/libtest/globals.c @@ -0,0 +1,44 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +volatile int libtest_malloc_is_custom = -1; +volatile int libtest_calloc_is_custom = -1; +volatile int libtest_realloc_is_custom = -1; +volatile int libtest_reallocarray_is_custom = -1; +volatile int libtest_valloc_is_custom = -1; +volatile int libtest_pvalloc_is_custom = -1; +volatile int libtest_memalign_is_custom = -1; +volatile int libtest_aligned_alloc_is_custom = -1; +volatile int libtest_posix_memalign_is_custom = -1; +volatile int libtest_malloc_usable_size_is_custom = -1; +volatile int libtest_free_is_custom = -1; +volatile int libtest_free_sized_is_custom = -1; +volatile int libtest_free_aligned_sized_is_custom = -1; + +struct meminfo libtest_allocs_head; +struct meminfo libtest_allocs_tail; +int libtest_allocs_list_inited = 0; +atomic_flag libtest_allocs_list_spinlock = ATOMIC_FLAG_INIT; + +int libtest_zero_on_alloc = 0; +int libtest_expect_zeroed = 0; +int libtest_malloc_accept_leakage = 1; + +_Thread_local size_t libtest_malloc_internal_usage = 0u; +_Thread_local size_t libtest_kill_malloc_tracking = 0u; + + +#else + + +CONST int +main(void) +{ + /* There isn't really anything to test here */ + return 0; +} + + +#endif -- cgit v1.2.3-70-g09d2