# ifndef SMALL_CONFIG
if (GC_print_stats) {
GET_TIME(start_time);
- GC_stats_log_printf("Initiating full world-stop collection!\n");
+ GC_log_printf("Initiating full world-stop collection!\n");
}
# endif
GC_promote_black_lists();
# ifndef SMALL_CONFIG
if (GC_print_stats) {
GET_TIME(current_time);
- GC_stats_log_printf("Complete collection took %lu msecs\n",
- MS_TIME_DIFF(current_time,start_time));
+ GC_log_printf("Complete collection took %lu msecs\n",
+ MS_TIME_DIFF(current_time,start_time));
}
# endif
return(TRUE);
}
GC_gc_no++;
- GC_COND_LOG_PRINTF("GC #%lu reclaimed %ld bytes --> heapsize: %lu"
- " bytes" IF_USE_MUNMAP(" (%lu unmapped)") "\n",
- (unsigned long)GC_gc_no, (long)GC_bytes_found,
- (unsigned long)GC_heapsize /*, */
- COMMA_IF_USE_MUNMAP((unsigned long)GC_unmapped_bytes));
+ GC_DBGLOG_PRINTF("GC #%lu reclaimed %ld bytes --> heapsize: %lu"
+ " bytes" IF_USE_MUNMAP(" (%lu unmapped)") "\n",
+ (unsigned long)GC_gc_no, (long)GC_bytes_found,
+ (unsigned long)GC_heapsize /*, */
+ COMMA_IF_USE_MUNMAP((unsigned long)GC_unmapped_bytes));
/* Check all debugged objects for consistency */
if (GC_debugging_started) {
world_stopped_total_divisor = ++divisor;
GC_ASSERT(divisor != 0);
- GC_stats_log_printf(
+ GC_log_printf(
"World-stopped marking took %lu msecs (%u in average)\n",
time_diff, total_time / divisor);
}
# ifndef SMALL_CONFIG
if (GC_print_stats) {
GET_TIME(done_time);
-
- /* A convenient place to output finalization statistics. */
# ifndef GC_NO_FINALIZATION
+ /* A convenient place to output finalization statistics. */
GC_print_finalization_stats();
# endif
-
- GC_stats_log_printf(
- "Finalize plus initiate sweep took %lu + %lu msecs\n",
- MS_TIME_DIFF(finalize_time,start_time),
- MS_TIME_DIFF(done_time,finalize_time));
+ GC_log_printf("Finalize plus initiate sweep took %lu + %lu msecs\n",
+ MS_TIME_DIFF(finalize_time,start_time),
+ MS_TIME_DIFF(done_time,finalize_time));
}
# endif
}
GC_word GC_max_retries = 0;
-/*
- * this explicitly increases the size of the heap. It is used
- * internally, but may also be invoked from GC_expand_hp by the user.
- * The argument is in units of HBLKSIZE.
- * Tiny values of n are rounded up.
- * Returns FALSE on failure.
- */
+/* This explicitly increases the size of the heap. It is used */
+/* internally, but may also be invoked from GC_expand_hp by the user. */
+/* The argument is in units of HBLKSIZE (tiny values are rounded up). */
+/* Returns FALSE on failure. */
GC_INNER GC_bool GC_expand_hp_inner(word n)
{
word bytes;
WARN("Failed to expand heap by %" WARN_PRIdPTR " bytes\n", bytes);
return(FALSE);
}
- GC_COND_LOG_PRINTF(
+ GC_INFOLOG_PRINTF(
"Increasing heap size by %lu after %lu allocated bytes\n",
(unsigned long)bytes, (unsigned long)GC_bytes_allocd);
/* Adjust heap limits generously for blacklisting to work better. */
struct finalizable_object *fo;
unsigned long ready = 0;
- GC_stats_log_printf("%lu finalization entries;"
- " %lu/%lu short/long disappearing links alive\n",
- (unsigned long)GC_fo_entries,
- (unsigned long)GC_dl_hashtbl.entries,
- (unsigned long)IF_LONG_REFS_PRESENT_ELSE(
+ GC_log_printf("%lu finalization entries;"
+ " %lu/%lu short/long disappearing links alive\n",
+ (unsigned long)GC_fo_entries,
+ (unsigned long)GC_dl_hashtbl.entries,
+ (unsigned long)IF_LONG_REFS_PRESENT_ELSE(
GC_ll_hashtbl.entries, 0));
for (fo = GC_finalize_now; 0 != fo; fo = fo_next(fo))
++ready;
- GC_stats_log_printf("%lu finalization-ready objects;"
- " %ld/%ld short/long links cleared\n",
- ready,
- (long)GC_old_dl_entries - (long)GC_dl_hashtbl.entries,
- (long)IF_LONG_REFS_PRESENT_ELSE(
+ GC_log_printf("%lu finalization-ready objects;"
+ " %ld/%ld short/long links cleared\n",
+ ready,
+ (long)GC_old_dl_entries - (long)GC_dl_hashtbl.entries,
+ (long)IF_LONG_REFS_PRESENT_ELSE(
GC_old_ll_entries - GC_ll_hashtbl.entries, 0));
}
#endif /* !SMALL_CONFIG */
#endif
#ifndef GC_ANDROID_LOG
- /* GC_stats_log_printf should be called only if GC_print_stats. */
-# define GC_stats_log_printf GC_log_printf
+# define GC_DBGLOG_PRINTF GC_COND_LOG_PRINTF
+# define GC_INFOLOG_PRINTF GC_COND_LOG_PRINTF
/* GC_verbose_log_printf is called only if GC_print_stats is VERBOSE. */
# define GC_verbose_log_printf GC_log_printf
#else
- GC_INNER void GC_stats_log_printf(const char *format, ...)
+ extern GC_bool GC_quiet;
+ /* These loggers are enabled even if GC_print_stats is off. */
+# ifndef GC_DBGLOG_PRINTF
+# define GC_DBGLOG_PRINTF if (GC_quiet) {} else GC_log_printf
+# endif
+# ifndef GC_INFOLOG_PRINTF
+# define GC_INFOLOG_PRINTF if (GC_quiet) {} else GC_info_log_printf
+# endif
+ GC_INNER void GC_info_log_printf(const char *format, ...)
GC_ATTR_FORMAT_PRINTF(1, 2);
GC_INNER void GC_verbose_log_printf(const char *format, ...)
GC_ATTR_FORMAT_PRINTF(1, 2);
#endif /* GC_ANDROID_LOG */
-/* Convenient macros for GC_stats/verbose_log_printf invocation. */
-#define GC_COND_LOG_PRINTF if (!GC_print_stats) {} else GC_stats_log_printf
+/* Convenient macros for GC_[verbose_]log_printf invocation. */
+#define GC_COND_LOG_PRINTF if (!GC_print_stats) {} else GC_log_printf
#define GC_VERBOSE_LOG_PRINTF \
if (GC_print_stats != VERBOSE) {} else GC_verbose_log_printf