diff options
author | Keith Packard <keithp@keithp.com> | 2017-12-17 22:22:50 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-12-17 22:22:50 -0800 |
commit | e1a6b3bf458f311d832aea7eec34935d42f8efed (patch) | |
tree | 7141f7e4ae75f23969722f75517f4c39cb623263 /src/scheme/ao_scheme.h | |
parent | 9d1131da911f7220ac8b6cb7ba5a0afd3deef657 (diff) |
altos/scheme: Use memory manager mark code to note recursive print
This flags any object being printed and checks before recursing to
avoid infinite loops.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/scheme/ao_scheme.h')
-rw-r--r-- | src/scheme/ao_scheme.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/scheme/ao_scheme.h b/src/scheme/ao_scheme.h index 48d0149b..cc7f8f1d 100644 --- a/src/scheme/ao_scheme.h +++ b/src/scheme/ao_scheme.h @@ -555,6 +555,21 @@ ao_scheme_move_memory(const struct ao_scheme_type *type, void **ref); void * ao_scheme_alloc(int size); +/* Marks an object as being printed, returns 1 if it was already marked */ +int +ao_scheme_print_mark_addr(void *addr); + +int +ao_scheme_print_mark_poly(ao_poly poly); + +/* Notes that printing has started */ +void +ao_scheme_print_start(void); + +/* Notes that printing has ended */ +void +ao_scheme_print_stop(void); + #define AO_SCHEME_COLLECT_FULL 1 #define AO_SCHEME_COLLECT_INCREMENTAL 0 |