summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-19 07:16:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-19 07:16:50 -0700
commitf057826476218f1c277e6f14870b8f85184e1e38 (patch)
tree165d140358ec91bc9dc1b50714794b484baf1b40 /parser.c
parent36a61da3883e8baca45a80c703211ae71be4c6ff (diff)
downloadtxr-f057826476218f1c277e6f14870b8f85184e1e38.tar.gz
txr-f057826476218f1c277e6f14870b8f85184e1e38.tar.bz2
txr-f057826476218f1c277e6f14870b8f85184e1e38.zip
Provide conservative marking interface.
GC now exports a function for marking something that might not be an object, instead of a function for testing. The previous way wasn't integrated with Valgrind properly, and didn't observe the FREE flag. * gc.c (gc_is_heap_obj): Function removed. (mark_obj_maybe): New static function, with body consisting of code moved from mark_mem_region. (mark_mem_region): Moved code replaced by call to mark_obj_maybe. (gc_conservative_mark): New function, wraps mark_obj_maybe. * gc.h (gc_conservative_mark): Declared. (gc_is_heap_obj): Declaration removed. * parser.c (yy_tok_mark): Use gc_conservative_mark instead of gc_is_heap_obj check and gc_mark.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/parser.c b/parser.c
index c5342ae9..bb5205f2 100644
--- a/parser.c
+++ b/parser.c
@@ -54,10 +54,7 @@ static val stream_parser_hash;
static void yy_tok_mark(struct yy_token *tok)
{
- obj_t *ptr = tok->yy_lval.val;
-
- if (gc_is_heap_obj(ptr))
- gc_mark(ptr);
+ gc_conservative_mark(tok->yy_lval.val);
}
static void parser_mark(val obj)