From b1cf353d57f27a39b67bea7826e8891b5a0a01a8 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 25 Jul 2021 23:13:40 +0300 Subject: Add dummy testing of GC_incr_bytes_allocd/freed * tests/test.c: Include private/gc_alloc_ptrs.h. * tests/test.c (inc_int_counter): Call GC_incr_bytes_allocd(0) and GC_incr_bytes_freed(0) (this is done in the function called from GC_call_with_alloc_lock to avoid complains of data race analysis tools). --- tests/test.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index dcfd5a5e..6ba83aec 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1309,10 +1309,17 @@ static void uniq(void *p, ...) { } } +#include "private/gc_alloc_ptrs.h" + void * GC_CALLBACK inc_int_counter(void *pcounter) { - ++(*(int *)pcounter); - return NULL; + ++(*(int *)pcounter); + + /* Dummy checking of API functions while GC lock is held. */ + GC_incr_bytes_allocd(0); + GC_incr_bytes_freed(0); + + return NULL; } struct thr_hndl_sb_s { -- cgit v1.2.1