Exemplo n.º 1
0
void
sml_heap_free()
{
	heap_space_free(&sml_heap_from_space);
	heap_space_free(&sml_heap_to_space);

#ifdef GCTIME
	sml_timer_now(gcstat.exec_end);
	sml_timer_dif(gcstat.exec_begin, gcstat.exec_end, gcstat.exec_time);
#endif /* GCTIME */
#if defined GCSTAT || defined GCTIME
#ifdef GCSTAT
	stat_notice("---");
	stat_notice("event: finish");
	stat_notice("time: "TIMEFMT, TIMEARG(gcstat.exec_time));
	print_alloc_count();
#endif /* GCSTAT */
	stat_notice("exec time      : "TIMEFMT" #sec",
		    TIMEARG(gcstat.exec_time));
	stat_notice("gc count       : %u #times", gcstat.gc.count);
	stat_notice("gc time        : "TIMEFMT" #sec (%4.2f%%), avg: %.6f sec",
		    TIMEARG(gcstat.gc.total_time),
		    TIMEFLOAT(gcstat.gc.total_time)
		    / TIMEFLOAT(gcstat.exec_time) * 100.0f,
		    TIMEFLOAT(gcstat.gc.total_time)
		    / (double)gcstat.gc.count);
#ifdef GCSTAT
	stat_notice("total copy bytes    :%10lu #bytes, avg:%8.2f bytes",
		    gcstat.gc.total_copy_bytes,
		    (double)gcstat.gc.total_copy_bytes
		    / (double)gcstat.gc.count);
	stat_notice("total copy count    :%10lu #times, avg:%8.2f times",
		    gcstat.gc.total_copy_count,
		    (double)gcstat.gc.total_copy_count
		    / (double)gcstat.gc.count);
	stat_notice("total forward count :%10lu #times, avg:%8.2f times",
		    gcstat.gc.total_forward_count,
		    (double)gcstat.gc.total_forward_count
		    / (double)gcstat.gc.count);
	if (gcstat.file)
		fclose(gcstat.file);
#endif /* GCSTAT */
#endif /* GCSTAT || GCTIME */
}
Exemplo n.º 2
0
void
sml_heap_free()
{
#ifdef PRINT_ALLOC_TIME
    print_and_close_file();
#endif /* PRINT_ALLOC_TIME */

    free(major_heap.base);

#ifdef GCTIME
    sml_timer_now(gcstat.exec_end);
    sml_timer_dif(gcstat.exec_begin, gcstat.exec_end, gcstat.exec_time);
#endif /* GCTIME */
#if defined GCSTAT || defined GCTIME
#ifdef GCSTAT
    stat_notice("---");
    stat_notice("event: finish");
    stat_notice("time: "TIMEFMT, TIMEARG(gcstat.exec_time));
    print_alloc_count();
#endif /* GCSTAT */
    stat_notice("exec time      : "TIMEFMT" #sec",
                TIMEARG(gcstat.exec_time));
    stat_notice("gc count       : %u #times", gcstat.gc.count);
    stat_notice("gc time        : "TIMEFMT" #sec (%4.2f%%)",
                TIMEARG(gcstat.gc.total_time),
                TIMEFLOAT(gcstat.gc.total_time) / TIMEFLOAT(gcstat.exec_time)
                * 100.0f);
    stat_notice("avg gc time    : %.6f #sec",
                TIMEFLOAT(gcstat.gc.total_time) / (double)gcstat.gc.count);
//#ifdef GCSTAT
    stat_notice("clear time     : "TIMEFMT" #sec (%4.2f%%)",
                TIMEARG(gcstat.gc.clear_time),
                TIMEFLOAT(gcstat.gc.clear_time) / TIMEFLOAT(gcstat.gc.total_time)
                * 100.0f);
    stat_notice("avg clear time : %.6f #sec",
                TIMEFLOAT(gcstat.gc.clear_time) / (double)gcstat.gc.count);

#ifdef GCSTAT
    if (gcstat.file)
        fclose(gcstat.file);
#endif /* GCSTAT */
#endif /* GCSTAT || GCTIME */
}