aboutsummaryrefslogtreecommitdiffstats
path: root/libtest/globals.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-08 22:29:35 +0200
committerMattias Andrée <m@maandree.se>2026-05-08 22:29:35 +0200
commit2d3a573977417d917c16742d8d9d8ead047d0ebc (patch)
treecaeac52856a9df0478e2bee53e5dda1f84422461 /libtest/globals.c
parentAdd DEFAULT_SUPPORT option and improve DEPENDENCIES (diff)
downloadlibrecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.gz
librecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.bz2
librecrypt-2d3a573977417d917c16742d8d9d8ead047d0ebc.tar.xz
Misc
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libtest/globals.c')
-rw-r--r--libtest/globals.c44
1 files changed, 44 insertions, 0 deletions
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