From: Ivan Maidanski Date: Sat, 24 Mar 2012 10:24:27 +0000 (+0400) Subject: Fix GC_clear_stack declaration and make it public X-Git-Tag: gc7_3alpha2~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f574788c50c0bcdba1a81f9b0894e3c69ba12ae;p=gc Fix GC_clear_stack declaration and make it public (Includes reverting part of commit b2345fb) * include/gc_mark.h (GC_clear_stack): New API function. * include/private/gc_priv.h (GC_clear_stack): Remove declaration. * misc.c (GC_clear_stack): Replace GC_INNER with GC_API; add GC_CALL calling conventions modifier. --- diff --git a/include/gc_mark.h b/include/gc_mark.h index d740e897..57bfc653 100644 --- a/include/gc_mark.h +++ b/include/gc_mark.h @@ -213,6 +213,11 @@ GC_API void GC_CALL GC_register_describe_type_fn(int /* kind */, /* to be used when printing objects */ /* of a particular kind. */ +/* Clear some of the inaccessible part of the stack. Returns its */ +/* argument, so it can be used in a tail call position, hence clearing */ +/* another frame. Argument may be NULL. */ +GC_API void * GC_CALL GC_clear_stack(void *); + /* Set and get the client notifier on collections. The client function */ /* is called at the start of every full GC (called with the allocation */ /* lock held). May be 0. This is a really tricky interface to use */ diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index bff14622..4acf1fd7 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1791,9 +1791,6 @@ GC_INNER ptr_t GC_allocobj(size_t sz, int kind); /* free list nonempty, and return its */ /* head. Sz is in granules. */ -GC_INNER void * GC_clear_stack(void *); - /* in misc.c, behaves like identity. */ - #ifdef GC_ADD_CALLER # define GC_DBG_RA GC_RETURN_ADDR, #else diff --git a/misc.c b/misc.c index c5e64eec..4ad474f5 100644 --- a/misc.c +++ b/misc.c @@ -292,7 +292,7 @@ GC_INNER void GC_extend_size_map(size_t i) /* Clear some of the inaccessible part of the stack. Returns its */ /* argument, so it can be used in a tail call position, hence clearing */ /* another frame. */ -GC_INNER void * GC_clear_stack(void *arg) +GC_API void * GC_CALL GC_clear_stack(void *arg) { ptr_t sp = GC_approx_sp(); /* Hotter than actual sp */ # ifdef THREADS