diff options
Diffstat (limited to 'Build/source/utils/asymptote/runbacktrace.in')
-rw-r--r-- | Build/source/utils/asymptote/runbacktrace.in | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/runbacktrace.in b/Build/source/utils/asymptote/runbacktrace.in new file mode 100644 index 00000000000..416ac437166 --- /dev/null +++ b/Build/source/utils/asymptote/runbacktrace.in @@ -0,0 +1,35 @@ +/***** + * 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 +} |