From 3c784ae4f4b25ebcc4019b77c77a7e365fdac261 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 25 Nov 2009 15:46:54 -0800 Subject: More Valgrind support. New option --vg-debug which turns on Valgrind protection of free blocks. This works independently of --gc-debug. --- txr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'txr.c') diff --git a/txr.c b/txr.c index f73ed961..8f87571e 100644 --- a/txr.c +++ b/txr.c @@ -270,6 +270,17 @@ static int txr_main(int argc, char **argv) opt_gc_debug = 1; argv++, argc--; continue; + } else if (!strcmp(*argv, "--vg-debug")) { +#ifdef HAVE_VALGRIND + opt_vg_debug = 1; + argv++, argc--; + continue; +#else + format(std_error, + lit("~a: option ~a requires Valgrind support compiled in\n"), + prog_string, string_utf8(*argv), nao); + return EXIT_FAILURE; +#endif } { -- cgit v1.2.3