From c3fb80019f9df0f14528cddddbafa277fb4149f2 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 12 Jan 2018 00:56:36 +0300 Subject: New API function (get_expl_freed_bytes_since_gc) Note: this function could be used in test_cpp to check that the proper operator delete is called. * include/gc.h (GC_get_expl_freed_bytes_since_gc): New function prototype. * mallocx.c (GC_get_expl_freed_bytes_since_gc): New function definition (which returns GC_bytes_freed). --- mallocx.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mallocx.c') diff --git a/mallocx.c b/mallocx.c index 242804a6..6440311d 100644 --- a/mallocx.c +++ b/mallocx.c @@ -259,6 +259,11 @@ GC_API void GC_CALL GC_incr_bytes_freed(size_t n) GC_bytes_freed += n; } +GC_API size_t GC_CALL GC_get_expl_freed_bytes_since_gc(void) +{ + return (size_t)GC_bytes_freed; +} + # ifdef PARALLEL_MARK STATIC volatile AO_t GC_bytes_allocd_tmp = 0; /* Number of bytes of memory allocated since */ -- cgit v1.2.1