Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ word GC_gc_no = 0;
measure_performance = TRUE;
}

GC_API void GC_CALL GC_enable_benchmark_stats(void)
{
const char *fname = TRUSTED_STRING(GETENV("GC_LOG_FILE"));
if (NULL == fname)
return;
GC_benchmark = 1;
}

GC_API unsigned long GC_CALL GC_get_full_gc_total_time(void)
{
return full_gc_total_time;
Expand Down
4 changes: 4 additions & 0 deletions include/gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ GC_API GC_word GC_CALL GC_get_allocd_bytes_per_finalizer(void);
/* library has been compiled without NO_CLOCK. */
GC_API void GC_CALL GC_start_performance_measurement(void);

/* Tell the collector to log performance and memory measurements from */
/* each collection to GC_LOG_FILE. */
GC_API void GC_CALL GC_enable_benchmark_stats(void);

/* Get the total time of all full collections since the start of the */
/* performance measurements. Includes time spent in the supplementary */
/* actions like blacklists promotion, marks clearing, free lists */
Expand Down