diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-19 07:16:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-19 07:16:50 -0700 |
commit | f057826476218f1c277e6f14870b8f85184e1e38 (patch) | |
tree | 165d140358ec91bc9dc1b50714794b484baf1b40 /parser.c | |
parent | 36a61da3883e8baca45a80c703211ae71be4c6ff (diff) | |
download | txr-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.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -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) |