From: Ivan Maidanski Date: Thu, 11 Jan 2018 22:08:37 +0000 (+0300) Subject: New field (expl_freed_bytes_since_gc) in public prof_stats_s X-Git-Tag: v8.0.0~431 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d9cc38c21156ad4aaf4f7c22bd997038ff11c37;p=gc New field (expl_freed_bytes_since_gc) in public prof_stats_s * include/gc.h (GC_prof_stats_s): Add expl_freed_bytes_since_gc field (to the end of the structure). * misc.c [!GC_GET_HEAP_USAGE_NOT_NEEDED] (fill_prof_stats): Store GC_bytes_freed value to pstats->expl_freed_bytes_since_gc. --- diff --git a/include/gc.h b/include/gc.h index 24a2bd0e..471f57fb 100644 --- a/include/gc.h +++ b/include/gc.h @@ -744,6 +744,9 @@ struct GC_prof_stats_s { GC_word reclaimed_bytes_before_gc; /* Approximate number of bytes reclaimed before the recent */ /* garbage collection. The value may wrap. */ + GC_word expl_freed_bytes_since_gc; + /* Number of bytes freed explicitly since the recent GC. */ + /* Same as returned by GC_get_expl_freed_bytes_since_gc(). */ }; /* Atomically get GC statistics (various global counters). Clients */ diff --git a/misc.c b/misc.c index 0c40e9ba..70f5e9f0 100644 --- a/misc.c +++ b/misc.c @@ -521,6 +521,7 @@ GC_API void GC_CALL GC_get_heap_usage_safe(GC_word *pheap_size, pstats->bytes_reclaimed_since_gc = GC_bytes_found > 0 ? (word)GC_bytes_found : 0; pstats->reclaimed_bytes_before_gc = GC_reclaimed_bytes_before_gc; + pstats->expl_freed_bytes_since_gc = GC_bytes_freed; /* since gc-7.7 */ } # include /* for memset() */