From 3551cb9fcad19520f3b1d0759b43a518f6ddd697 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 29 Oct 2016 10:14:42 +0300 Subject: [PATCH] Export GC_is_tmp_root() and GC_print_trace[_inner]() Note: these 3 functions are not used by GC itself. * include/gc_mark.h (GC_is_tmp_root, GC_print_trace, GC_print_trace_inner): New public API prototype. * mark.c [TRACE_BUF] (GC_print_trace_inner, GC_print_trace): Define as public (GC_API+GC_CALL). * mark_rts.c [MSWIN32 && !NO_DEBUGGING] (GC_is_tmp_root): Likewise. * mark_rts.c [MSWIN32 && !NO_DEBUGGING] (GC_is_tmp_root): Replace GC_bool return type with int, replace ptr_t argument type to void* (because GC_bool and ptr_t are not exported from GC). --- include/gc_mark.h | 5 +++++ mark.c | 4 ++-- mark_rts.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/gc_mark.h b/include/gc_mark.h index 330d71e8..7324abd8 100644 --- a/include/gc_mark.h +++ b/include/gc_mark.h @@ -305,6 +305,11 @@ GC_API void GC_CALL GC_enumerate_reachable_objects_inner( GC_reachable_object_proc, void * /* client_data */) GC_ATTR_NONNULL(1); +GC_API int GC_CALL GC_is_tmp_root(void *); + +GC_API void GC_CALL GC_print_trace(GC_word /* gc_no */); +GC_API void GC_CALL GC_print_trace_inner(GC_word /* gc_no */); + #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/mark.c b/mark.c index 55df531b..06a0b4ba 100644 --- a/mark.c +++ b/mark.c @@ -1490,7 +1490,7 @@ void GC_add_trace_entry(char *kind, word arg1, word arg2) if (GC_trace_buf_ptr >= TRACE_ENTRIES) GC_trace_buf_ptr = 0; } -void GC_print_trace_inner(word gc_no) +GC_API void GC_CALL GC_print_trace_inner(word gc_no) { int i; @@ -1510,7 +1510,7 @@ void GC_print_trace_inner(word gc_no) GC_printf("Trace incomplete\n"); } -void GC_print_trace(word gc_no) +GC_API void GC_CALL GC_print_trace(word gc_no) { DCL_LOCK_STATE; diff --git a/mark_rts.c b/mark_rts.c index 6186807f..e58398dc 100644 --- a/mark_rts.c +++ b/mark_rts.c @@ -369,7 +369,7 @@ STATIC void GC_remove_tmp_roots(void) /* Not used at present (except for, may be, debugging purpose). */ /* Workaround for the OS mapping and unmapping behind our back: */ /* Is the address p in one of the temporary static root sections? */ - GC_bool GC_is_tmp_root(ptr_t p) + GC_API int GC_CALL GC_is_tmp_root(void *p) { static int last_root_set = MAX_ROOT_SETS; register int i; -- 2.40.0