(unsigned long) GC_gc_no, (unsigned long)GC_max_height);
if (GC_max_height > GC_max_max_height) {
GC_max_max_height = GC_max_height;
- GC_printf("The following unreachable object is last in a longest chain "
- "of unreachable objects:\n");
+ GC_err_printf(
+ "The following unreachable object is last in a longest chain "
+ "of unreachable objects:\n");
GC_print_heap_obj(GC_deepest_obj);
}
if (GC_print_stats) {
}
# ifdef DEBUG_THREADS
- /* GC_printf("FindTopOfStack start at sp = %p\n", frame); */
+ /* GC_log_printf("FindTopOfStack start at sp = %p\n", frame); */
# endif
while (frame->savedSP != 0) {
/* if there are no more stack frames, stop */
break; /* if the next LR is bogus, stop */
}
# ifdef DEBUG_THREADS
- /* GC_printf("FindTopOfStack finish at sp = %p\n", frame); */
+ /* GC_log_printf("FindTopOfStack finish at sp = %p\n", frame); */
# endif
return (ptr_t)frame;
}
#endif
/* Logging and diagnostic output: */
+/* GC_printf is used typically on client explicit print requests. */
GC_API_PRIV void GC_printf(const char * format, ...)
GC_ATTR_FORMAT_PRINTF(1, 2);
/* A version of printf that doesn't allocate, */
#if defined(__cplusplus) && defined(SYMBIAN)
extern "C" {
#endif
+/* Logging routine. Typically called only if GC_print_stats. It is */
+/* recommended to put "\n" at 'format' string end (for atomicity). */
GC_API_PRIV void GC_log_printf(const char * format, ...)
GC_ATTR_FORMAT_PRINTF(1, 2);
#if defined(__cplusplus) && defined(SYMBIAN)
if (p == 0) return;
/* Required by ANSI. It's not my fault ... */
# ifdef LOG_ALLOCS
- GC_err_printf("GC_free(%p), GC: %lu\n", p, (unsigned long)GC_gc_no);
+ GC_log_printf("GC_free(%p), GC: %lu\n", p, (unsigned long)GC_gc_no);
# endif
h = HBLKPTR(p);
hhdr = HDR(h);
GC_FAST_MALLOC_GRANS(result, granules, tiny_fl, DIRECT_GRANULES,
NORMAL, GC_core_malloc(bytes), obj_link(result)=0);
# ifdef LOG_ALLOCS
- GC_err_printf("GC_malloc(%lu) = %p, GC: %lu\n",
+ GC_log_printf("GC_malloc(%lu) = %p, GC: %lu\n",
(unsigned long)bytes, result, (unsigned long)GC_gc_no);
# endif
return result;