/*****
 * backtrace.in
 * Andy Hammerlindl  2009/07/28
 *
 * Runtime functions for printing garbage collector backtraces.
 *
 *****/

// No extra types defined.

// No extra code for .cc file.

// Autogenerated routines:


void generate_random_backtrace()
{
#if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE)
  GC_generate_random_backtrace();
#else
  error("generate_random_backtrace() requires ./configure --enable-gc-debug");
#endif
}

void print_random_addresses(Int n=1)
{
#if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE)
  GC_gcollect();
  for (Int i=0; i < n; ++i)
    GC_debug_print_heap_obj_proc(GC_base(GC_generate_random_valid_address()));
#else
  error("print_random_addresses() requires ./configure --enable-gc-debug");
  unused(&n); // Avoid unused variable warning message.
#endif
}
