]> granicus.if.org Git - gc/commit
Add 'bytes reclaimed' counters to public GC_prof_stats_s
authorIvan Maidanski <ivmai@mail.ru>
Wed, 7 Nov 2012 03:05:49 +0000 (07:05 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 7 Nov 2012 09:06:11 +0000 (13:06 +0400)
commit2d4cdb8f442e49f7d8b559f2a18d7c08887bbb45
treede743fb8caae7cca5bb0357b1a618b189e232e06
parentdaea29353d178fabcf9f396f9f652ea95afe4981
Add 'bytes reclaimed' counters to public GC_prof_stats_s

* alloc.c (GC_finish_collection): Add GC_bytes_found value to
GC_reclaimed_bytes_before_gc (if the former is non-negative and
not GC_GET_HEAP_USAGE_NOT_NEEDED) before reseting GC_bytes_found.
* include/gc.h (GC_prof_stats_s): Add bytes_reclaimed_since_gc and
reclaimed_bytes_before_gc fields.
* include/private/gc_priv.h (GC_reclaimed_bytes_before_gc): Declare
new GC inner variable (only if not GC_GET_HEAP_USAGE_NOT_NEEDED).
* misc.c (GC_reclaimed_bytes_before_gc): Define new variable (only if
not GC_GET_HEAP_USAGE_NOT_NEEDED).
* misc.c (fill_prof_stats): Fill in bytes_reclaimed_since_gc and
reclaimed_bytes_before_gc fields.
* tests/test.c (check_heap_stats): Invoke GC_get_heap_usage_safe,
GC_get_prof_stats, GC_get_prof_stats_unsafe (only if not
GC_GET_HEAP_USAGE_NOT_NEEDED).
alloc.c
include/gc.h
include/private/gc_priv.h
misc.c
tests/test.c