Cc: Vegard Nossum <vegard.nos...@gmail.com> Signed-off-by: Pekka Enberg <penb...@cs.helsinki.fi> --- include/vm/gc.h | 3 +++ vm/gc.c | 4 ++++ vm/jato.c | 6 ++++++ 3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/vm/gc.h b/include/vm/gc.h index a9bfae9..8cc7994 100644 --- a/include/vm/gc.h +++ b/include/vm/gc.h @@ -1,7 +1,10 @@ #ifndef VM_GC_H #define VM_GC_H +#include <stdbool.h> + extern void *gc_safepoint_page; +extern bool verbose_gc; void gc_init(void); diff --git a/vm/gc.c b/vm/gc.c index 5b6061a..af2bfa3 100644 --- a/vm/gc.c +++ b/vm/gc.c @@ -23,6 +23,7 @@ static bool can_continue; static pthread_cond_t can_enter_cond = PTHREAD_COND_INITIALIZER; static bool can_enter = true; +bool verbose_gc; void gc_init(void) { @@ -64,6 +65,9 @@ static void unhide_safepoint_guard_page(void) static void do_gc_reclaim(void) { + if (verbose_gc) + fprintf(stderr, "[GC]\n"); + /* TODO: Do main GC work here. */ } diff --git a/vm/jato.c b/vm/jato.c index b50ef52..b8af5d0 100644 --- a/vm/jato.c +++ b/vm/jato.c @@ -1072,6 +1072,11 @@ static void handle_define(const char *arg) free(str); } +static void handle_verbose_gc(void) +{ + verbose_gc = true; +} + struct option { const char *name; @@ -1102,6 +1107,7 @@ const struct option options[] = { DEFINE_OPTION_ARG("classpath", handle_classpath), DEFINE_OPTION_ARG("cp", handle_classpath), DEFINE_OPTION_ARG("jar", handle_jar), + DEFINE_OPTION("verbose:gc", handle_verbose_gc), DEFINE_OPTION("Xperf", handle_perf), -- 1.5.6.3 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel