summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-07-25 23:13:40 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-07-25 23:13:40 +0300
commitb1cf353d57f27a39b67bea7826e8891b5a0a01a8 (patch)
tree1727afcc8b6b98e3d030ab3e8d786e7bc79a37a2
parente07c701aab78f417f5c9c47fa4a1fc3e8cca7fff (diff)
downloadbdwgc-b1cf353d57f27a39b67bea7826e8891b5a0a01a8.tar.gz
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).
-rw-r--r--tests/test.c11
1 files 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 {