summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-26 00:42:44 -0500
committerKaz Kylheku <kaz@kylheku.com>2009-11-26 00:42:44 -0500
commit2f8a289f854cb8c9f8640b67f5071024a7f6333b (patch)
tree8e19f4d222ce347daec5d7c3c12f6445f9e6c756 /gc.c
parent863a20f1045b761ac65d7051bcca47e4eb01c81d (diff)
downloadtxr-2f8a289f854cb8c9f8640b67f5071024a7f6333b.tar.gz
txr-2f8a289f854cb8c9f8640b67f5071024a7f6333b.tar.bz2
txr-2f8a289f854cb8c9f8640b67f5071024a7f6333b.zip
* gc.c (mark_mem_region): Bugfix: do not mess with the valgrind
accessibility of the heap object if valgrind debugging is not enabled.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 2ba3231f..07bcea6e 100644
--- a/gc.c
+++ b/gc.c
@@ -301,14 +301,16 @@ static void mark_mem_region(val *low, val *high)
#endif
if (in_heap(maybe_obj)) {
#ifdef HAVE_VALGRIND
- VALGRIND_MAKE_MEM_DEFINED(maybe_obj, sizeof *maybe_obj);
+ if (opt_vg_debug)
+ VALGRIND_MAKE_MEM_DEFINED(maybe_obj, sizeof *maybe_obj);
#endif
type_t t = maybe_obj->t.type;
if ((t & FREE) == 0) {
mark_obj(maybe_obj);
} else {
#ifdef HAVE_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(maybe_obj, sizeof *maybe_obj);
+ if (opt_vg_debug)
+ VALGRIND_MAKE_MEM_NOACCESS(maybe_obj, sizeof *maybe_obj);
#endif
}
}