From: pcpa Date: Sun, 27 May 2012 18:30:01 +0000 (-0300) Subject: Export GC_push manipulation functions and function pointer. X-Git-Tag: gc7_4_0~13^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=460b6a0aa8ccebb0e918bbeab25c5e2da5ab01d4;p=platform%2Fupstream%2Flibgc.git Export GC_push manipulation functions and function pointer. * include/private/gc_priv.h, include/gc_mark.h: Move GC_push_all, GC_push_conditional and GC_push_other_roots to a public header and adjust prototypes and comment. * mark.c, os_dep.c: Adjust prototypes accordingly. --- diff --git a/include/gc_mark.h b/include/gc_mark.h index 57bfc65..ff2c131 100644 --- a/include/gc_mark.h +++ b/include/gc_mark.h @@ -236,6 +236,27 @@ GC_API int GC_CALL GC_is_marked(const void *) GC_ATTR_NONNULL(1); GC_API void GC_CALL GC_clear_mark_bit(const void *) GC_ATTR_NONNULL(1); GC_API void GC_CALL GC_set_mark_bit(const void *) GC_ATTR_NONNULL(1); +/* Helpers for dynamically changing roots. */ +GC_API void GC_push_all(char * /* bottom */, char * /* top */); + /* Push everything in a range */ + /* onto mark stack. */ +#ifndef GC_DISABLE_INCREMENTAL + GC_API void GC_push_conditional(char * /* b */, char * /* t */, + int /* all */); +#else +# define GC_push_conditional(b, t, all) GC_push_all(b, t) +#endif + /* Do either of the above, depending */ + /* on the third arg. */ + +GC_API void (*GC_push_other_roots)(void); + /* Push system or application specific roots */ + /* onto the mark stack. In some environments */ + /* (e.g. threads environments) this is */ + /* predefined to be non-zero. A client */ + /* supplied replacement should also call the */ + /* original function. */ + #ifdef __cplusplus } /* end of extern "C" */ #endif diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 5cfb543..f1e3d8f 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1509,19 +1509,10 @@ GC_INNER void GC_initiate_gc(void); GC_INNER GC_bool GC_collection_in_progress(void); /* Collection is in progress, or was abandoned. */ -GC_INNER void GC_push_all(ptr_t bottom, ptr_t top); - /* Push everything in a range */ - /* onto mark stack. */ -#ifndef GC_DISABLE_INCREMENTAL - GC_INNER void GC_push_conditional(ptr_t b, ptr_t t, GC_bool all); -#else -# define GC_push_conditional(b, t, all) GC_push_all(b, t) -#endif - /* Do either of the above, depending */ - /* on the third arg. */ GC_INNER void GC_push_all_stack(ptr_t b, ptr_t t); - /* As above, but consider */ - /* interior pointers as valid */ + /* Same as GC_push_all, but */ + /* consider interior pointers as */ + /* valid. */ GC_INNER void GC_push_all_eager(ptr_t b, ptr_t t); /* Same as GC_push_all_stack, but */ /* ensures that stack is scanned */ @@ -1537,14 +1528,6 @@ GC_INNER void GC_push_all_eager(ptr_t b, ptr_t t); GC_INNER void GC_push_roots(GC_bool all, ptr_t cold_gc_frame); /* Push all or dirty roots. */ -GC_EXTERN void (*GC_push_other_roots)(void); - /* Push system or application specific roots */ - /* onto the mark stack. In some environments */ - /* (e.g. threads environments) this is */ - /* predefined to be non-zero. A client */ - /* supplied replacement should also call the */ - /* original function. */ - #ifdef THREADS void GC_push_thread_structures(void); #endif diff --git a/mark.c b/mark.c index 8786e56..3432d88 100644 --- a/mark.c +++ b/mark.c @@ -1261,7 +1261,7 @@ GC_INNER void GC_mark_init(void) * Should only be used if there is no possibility of mark stack * overflow. */ -GC_INNER void GC_push_all(ptr_t bottom, ptr_t top) +GC_API void GC_push_all(ptr_t bottom, ptr_t top) { register word length; @@ -1334,7 +1334,7 @@ GC_INNER void GC_push_all(ptr_t bottom, ptr_t top) } } - GC_INNER void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all) + GC_API void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all) { if (!all) { GC_push_selected(bottom, top, GC_page_was_dirty); diff --git a/os_dep.c b/os_dep.c index 7a55872..6ad4f6b 100644 --- a/os_dep.c +++ b/os_dep.c @@ -2560,7 +2560,7 @@ GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2, /* environment, this is also responsible for marking from */ /* thread stacks. */ #ifndef THREADS - GC_INNER void (*GC_push_other_roots)(void) = 0; + GC_API void (*GC_push_other_roots)(void) = 0; #else /* THREADS */ # ifdef PCR @@ -2624,7 +2624,7 @@ STATIC void GC_default_push_other_roots(void) } # endif /* SN_TARGET_PS3 */ - GC_INNER void (*GC_push_other_roots)(void) = GC_default_push_other_roots; + GC_API void (*GC_push_other_roots)(void) = GC_default_push_other_roots; #endif /* THREADS */ /*