2009-10-22 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Thu, 22 Oct 2009 17:52:36 +0000 (17:52 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:51 +0000 (21:06 +0400)
* allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
GC_freehblk): Use GC_INNER for the function definition.
* alloc.c (GC_never_stop_func, GC_should_collect,
GC_try_to_collect_inner, GC_collect_a_little_inner,
GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Ditto.
* backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
Ditto.
* blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
GC_promote_black_lists, GC_unpromote_black_lists,
GC_add_to_black_list_normal, GC_add_to_black_list_stack,
GC_is_black_listed): Ditto.
* darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
GC_stop_init, GC_stop_world, GC_start_world): Ditto.
* dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
GC_store_debug_info, GC_start_debugging,
GC_debug_generic_malloc_inner,
GC_debug_generic_malloc_inner_ignore_off_page,
GC_debug_malloc_uncollectable, GC_debug_free_inner): Ditto.
* dyn_load.c (GC_register_dynamic_libraries,
GC_register_main_static_data, GC_init_dyld): Ditto.
* finalize.c (GC_push_finalizer_structures, GC_finalize,
GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
Ditto.
* gcj_mlc.c (GC_core_gcj_malloc): Ditto.
* headers.c (GC_find_header, GC_header_cache_miss,
GC_scratch_alloc, GC_init_headers, GC_install_header,
GC_install_counts, GC_remove_header, GC_remove_counts,
GC_next_used_block, GC_prev_block): Ditto.
* mach_dep.c (GC_with_callee_saves_pushed): Ditto.
* malloc.c (GC_collect_or_expand, GC_alloc_large,
GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Ditto.
* mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
* mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
GC_clear_marks, GC_initiate_gc, GC_mark_some,
GC_mark_stack_empty, GC_invalidate_mark_state,
GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
GC_mark_init, GC_push_all, GC_push_conditional,
GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
Ditto.
* mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
GC_exclude_static_roots_inner, GC_push_all_register_frames,
GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
GC_push_roots): Ditto.
* misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
Ditto.
* new_hblk.c (GC_build_fl, GC_new_hblk): Ditto.
* obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
GC_initialize_offsets): Ditto.
* os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
GC_page_was_ever_dirty, GC_remove_protection,
GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
GC_save_callers, GC_print_callers): Ditto.
* pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
GC_start_world, GC_stop_init): Ditto.
* pthread_support.c (GC_mark_thread_local_free_lists,
GC_lookup_thread, GC_reset_finalizer_nested,
GC_check_finalizer_nested, GC_segment_is_thread_stack,
GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
GC_wait_marker, GC_notify_all_marker): Ditto.
* reclaim.c (GC_print_all_errors, GC_block_empty,
GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
GC_reclaim_all): Ditto.
* thread_local_alloc.c (GC_init_thread_local,
GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
* win32_threads.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
GC_start_world, GC_push_all_stacks, GC_get_next_stack,
GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
GC_thr_init, GC_init_parallel, GC_lock,
GC_mark_thread_local_free_lists): Ditto.
* alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
GC_traverse_back_graph): Use GC_INNER for the function prototype.
* darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
Ditto.
* dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
* dyn_load.c (GC_parse_map_entry, GC_get_maps,
GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
GC_get_next_stack): Ditto.
* finalize.c (GC_reset_finalizer_nested,
GC_check_finalizer_nested): Ditto.
* gcj_mlc.c (GC_start_debugging): Ditto.
* include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
GC_has_other_debug_info, GC_store_debug_info): Ditto.
* include/private/gc_hdrs.h (GC_header_cache_miss): Ditto.
* include/private/gc_locks.h (GC_lock): Ditto.
* include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
GC_mark_from): Ditto.
* include/private/pthread_support.h (GC_lookup_thread,
GC_stop_init): Ditto.
* include/private/thread_local_alloc.h (GC_init_thread_local,
GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
* malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
* mark.c (GC_page_was_ever_dirty): Ditto.
* mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
* misc.c (GC_register_main_static_data, GC_init_win32,
GC_setpagesize, GC_init_linux_data_start,
GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
GC_do_blocking_inner): Ditto.
* os_dep.c (GC_greatest_stack_base_below): Ditto.
* win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
Ditto.
* include/private/gc_priv.h: Ditto (for most prototypes).
* include/private/gc_priv.h (GC_INNER): Update the comment.
* doc/README.macros (GC_DLL): Update.

33 files changed:
ChangeLog
allchblk.c
alloc.c
backgraph.c
blacklst.c
darwin_stop_world.c
dbg_mlc.c
doc/README.macros
dyn_load.c
finalize.c
gcj_mlc.c
headers.c
include/private/dbg_mlc.h
include/private/gc_hdrs.h
include/private/gc_locks.h
include/private/gc_pmark.h
include/private/gc_priv.h
include/private/pthread_support.h
include/private/thread_local_alloc.h
mach_dep.c
malloc.c
mallocx.c
mark.c
mark_rts.c
misc.c
new_hblk.c
obj_map.c
os_dep.c
pthread_stop_world.c
pthread_support.c
reclaim.c
thread_local_alloc.c
win32_threads.c

index e579099..60a2b5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,125 @@
 2009-10-22  Ivan Maidanski <ivmai@mail.ru>
 
+       * allchblk.c (GC_unmap_old, GC_merge_unmapped, GC_allochblk,
+       GC_freehblk): Use GC_INNER for the function definition.
+       * alloc.c (GC_never_stop_func, GC_should_collect,
+       GC_try_to_collect_inner, GC_collect_a_little_inner,
+       GC_set_fl_marks, GC_add_to_our_memory, GC_add_to_heap,
+       GC_expand_hp_inner, GC_collect_or_expand, GC_allocobj): Ditto.
+       * backgraph.c (GC_build_back_graph, GC_traverse_back_graph):
+       Ditto.
+       * blacklst.c (GC_default_print_heap_obj_proc, GC_bl_init,
+       GC_promote_black_lists, GC_unpromote_black_lists,
+       GC_add_to_black_list_normal, GC_add_to_black_list_stack,
+       GC_is_black_listed): Ditto.
+       * darwin_stop_world.c (GC_push_all_stacks, GC_push_all_stacks,
+       GC_stop_init, GC_stop_world, GC_start_world): Ditto.
+       * dbg_mlc.c (GC_has_other_debug_info, GC_store_back_pointer,
+       GC_marked_for_finalization, GC_generate_random_backtrace_no_gc,
+       GC_store_debug_info, GC_start_debugging,
+       GC_debug_generic_malloc_inner,
+       GC_debug_generic_malloc_inner_ignore_off_page,
+       GC_debug_malloc_uncollectable, GC_debug_free_inner): Ditto.
+       * dyn_load.c (GC_register_dynamic_libraries,
+       GC_register_main_static_data, GC_init_dyld): Ditto.
+       * finalize.c (GC_push_finalizer_structures, GC_finalize,
+       GC_notify_or_invoke_finalizers, GC_print_finalization_stats):
+       Ditto.
+       * gcj_mlc.c (GC_core_gcj_malloc): Ditto.
+       * headers.c (GC_find_header, GC_header_cache_miss,
+       GC_scratch_alloc, GC_init_headers, GC_install_header,
+       GC_install_counts, GC_remove_header, GC_remove_counts,
+       GC_next_used_block, GC_prev_block): Ditto.
+       * mach_dep.c (GC_with_callee_saves_pushed): Ditto.
+       * malloc.c (GC_collect_or_expand, GC_alloc_large,
+       GC_generic_malloc_inner, GC_generic_malloc_inner_ignore_off_page,
+       GC_core_malloc_atomic, GC_core_malloc, GC_free_inner): Ditto.
+       * mallocx.c (GC_generic_malloc_ignore_off_page): Ditto.
+       * mark.c (GC_collection_in_progress, GC_clear_hdr_marks,
+       GC_set_hdr_marks, GC_set_mark_bit, GC_clear_mark_bit,
+       GC_clear_marks, GC_initiate_gc, GC_mark_some,
+       GC_mark_stack_empty, GC_invalidate_mark_state,
+       GC_signal_mark_stack_overflow, GC_mark_from, GC_help_marker,
+       GC_mark_init, GC_push_all, GC_push_conditional,
+       GC_mark_and_push_stack, GC_push_all_eager, GC_push_all_stack):
+       Ditto.
+       * mark_rts.c (GC_is_static_root, GC_roots_present, GC_approx_sp,
+       GC_exclude_static_roots_inner, GC_push_all_register_frames,
+       GC_push_all_stack_frames, GC_cond_register_dynamic_libraries,
+       GC_push_roots): Ditto.
+       * misc.c (GC_extend_size_map, GC_clear_stack, GC_err_write):
+       Ditto.
+       * new_hblk.c (GC_build_fl, GC_new_hblk): Ditto.
+       * obj_map.c (GC_register_displacement_inner, GC_add_map_entry,
+       GC_initialize_offsets): Ditto.
+       * os_dep.c (GC_get_maps, GC_parse_map_entry, GC_text_mapping,
+       GC_init_linux_data_start, GC_init_netbsd_elf, GC_setpagesize,
+       GC_set_and_save_fault_handler, GC_setup_temporary_fault_handler,
+       GC_reset_fault_handler, GC_get_register_stack_base, GC_init_win32,
+       GC_add_current_malloc_heap, GC_is_heap_base, GC_unmap, GC_remap,
+       GC_unmap_gap, GC_push_all_stacks, GC_gww_dirty_init,
+       GC_dirty_init, GC_read_dirty, GC_page_was_dirty,
+       GC_page_was_ever_dirty, GC_remove_protection,
+       GC_write_fault_handler, GC_mprotect_stop, GC_mprotect_resume,
+       GC_save_callers, GC_print_callers): Ditto.
+       * pthread_stop_world.c (GC_push_all_stacks, GC_stop_world,
+       GC_start_world, GC_stop_init): Ditto.
+       * pthread_support.c (GC_mark_thread_local_free_lists,
+       GC_lookup_thread, GC_reset_finalizer_nested,
+       GC_check_finalizer_nested, GC_segment_is_thread_stack,
+       GC_greatest_stack_base_below, GC_thr_init, GC_init_parallel,
+       GC_do_blocking_inner, GC_lock, GC_acquire_mark_lock,
+       GC_release_mark_lock, GC_wait_for_reclaim, GC_notify_all_builder,
+       GC_wait_marker, GC_notify_all_marker): Ditto.
+       * reclaim.c (GC_print_all_errors, GC_block_empty,
+       GC_reclaim_generic, GC_start_reclaim, GC_continue_reclaim,
+       GC_reclaim_all): Ditto.
+       * thread_local_alloc.c (GC_init_thread_local,
+       GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
+       * win32_threads.c (GC_reset_finalizer_nested,
+       GC_check_finalizer_nested, GC_do_blocking_inner, GC_stop_world,
+       GC_start_world, GC_push_all_stacks, GC_get_next_stack,
+       GC_acquire_mark_lock, GC_release_mark_lock, GC_wait_for_reclaim,
+       GC_notify_all_builder, GC_wait_marker, GC_notify_all_marker,
+       GC_thr_init, GC_init_parallel, GC_lock,
+       GC_mark_thread_local_free_lists): Ditto.
+       * alloc.c (GC_add_current_malloc_heap, GC_build_back_graph,
+       GC_traverse_back_graph): Use GC_INNER for the function prototype.
+       * darwin_stop_world.c (GC_mprotect_stop, GC_mprotect_resume):
+       Ditto.
+       * dbg_mlc.c (GC_default_print_heap_obj_proc): Ditto.
+       * dyn_load.c (GC_parse_map_entry, GC_get_maps,
+       GC_segment_is_thread_stack, GC_roots_present, GC_is_heap_base,
+       GC_get_next_stack): Ditto.
+       * finalize.c (GC_reset_finalizer_nested,
+       GC_check_finalizer_nested): Ditto.
+       * gcj_mlc.c (GC_start_debugging): Ditto.
+       * include/private/dbg_mlc.h (GC_save_callers, GC_print_callers,
+       GC_has_other_debug_info, GC_store_debug_info): Ditto.
+       * include/private/gc_hdrs.h (GC_header_cache_miss): Ditto.
+       * include/private/gc_locks.h (GC_lock): Ditto.
+       * include/private/gc_pmark.h (GC_signal_mark_stack_overflow,
+       GC_mark_from): Ditto.
+       * include/private/pthread_support.h (GC_lookup_thread,
+       GC_stop_init): Ditto.
+       * include/private/thread_local_alloc.h (GC_init_thread_local,
+       GC_destroy_thread_local, GC_mark_thread_local_fls_for): Ditto.
+       * malloc.c (GC_extend_size_map, GC_text_mapping): Ditto.
+       * mark.c (GC_page_was_ever_dirty): Ditto.
+       * mark_rts.c (GC_mark_thread_local_free_lists): Ditto.
+       * misc.c (GC_register_main_static_data, GC_init_win32,
+       GC_setpagesize, GC_init_linux_data_start,
+       GC_set_and_save_fault_handler, GC_init_dyld, GC_init_netbsd_elf,
+       GC_do_blocking_inner): Ditto.
+       * os_dep.c (GC_greatest_stack_base_below): Ditto.
+       * win32_threads.c (GC_write_fault_handler, GC_gww_dirty_init):
+       Ditto.
+       * include/private/gc_priv.h: Ditto (for most prototypes).
+       * include/private/gc_priv.h (GC_INNER): Update the comment.
+       * doc/README.macros (GC_DLL): Update.
+
+2009-10-22  Ivan Maidanski <ivmai@mail.ru>
+
        * alloc.c (GC_collection_in_progress): Move the prototype to
        gc_priv.h.
        * gc_dlopen.c (GC_collection_in_progress): Ditto.
index 1c8c62d..2c243ac 100644 (file)
@@ -267,7 +267,7 @@ static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
 #   endif /* MARK_BIT_PER_GRANULE */
 
     /* Clear mark bits */
-      GC_clear_hdr_marks(hhdr);
+    GC_clear_hdr_marks(hhdr);
 
     hhdr -> hb_last_reclaimed = (unsigned short)GC_gc_no;
     return(TRUE);
@@ -390,7 +390,7 @@ GC_INNER int GC_unmap_threshold = MUNMAP_THRESHOLD;
 
 /* Unmap blocks that haven't been recently touched.  This is the only way */
 /* way blocks are ever unmapped.                                          */
-void GC_unmap_old(void)
+GC_INNER void GC_unmap_old(void)
 {
     struct hblk * h;
     hdr * hhdr;
@@ -416,7 +416,7 @@ void GC_unmap_old(void)
 /* Merge all unmapped blocks that are adjacent to other free            */
 /* blocks.  This may involve remapping, since all blocks are either     */
 /* fully mapped or fully unmapped.                                      */
-void GC_merge_unmapped(void)
+GC_INNER void GC_merge_unmapped(void)
 {
     struct hblk * h, *next;
     hdr * hhdr, *nexthdr;
@@ -572,7 +572,7 @@ GC_allochblk_nth(size_t sz/* bytes */, int kind, unsigned flags, int n,
  *
  * The client is responsible for clearing the block, if necessary.
  */
-struct hblk *
+GC_INNER struct hblk *
 GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
 {
     word blocks;
@@ -638,7 +638,8 @@ STATIC long GC_large_alloc_warn_suppressed = 0;
  * The may_split flag indicates whether it's OK to split larger blocks.
  */
 STATIC struct hblk *
-GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, GC_bool may_split)
+GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n,
+                 GC_bool may_split)
 {
     struct hblk *hbp;
     hdr * hhdr;         /* Header corr. to hbp */
@@ -819,8 +820,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, GC_bool may_split)
  *
  * All mark words are assumed to be cleared.
  */
-void
-GC_freehblk(struct hblk *hbp)
+GC_INNER void GC_freehblk(struct hblk *hbp)
 {
     struct hblk *next, *prev;
     hdr *hhdr, *prevhdr, *nexthdr;
@@ -832,7 +832,7 @@ GC_freehblk(struct hblk *hbp)
     if (size <= 0)
       ABORT("Deallocating excessively large block.  Too large an allocation?");
       /* Probably possible if we try to allocate more than half the address */
-      /* space at once.  If we dont catch it here, strange things happen    */
+      /* space at once.  If we don't catch it here, strange things happen   */
       /* later.                                                             */
     GC_remove_counts(hbp, (word)size);
     hhdr->hb_sz = size;
diff --git a/alloc.c b/alloc.c
index 7c4b8ee..3efbde7 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -118,7 +118,7 @@ GC_API unsigned GC_CALL GC_get_version(void)
 
 word GC_free_space_divisor = GC_FREE_SPACE_DIVISOR;
 
-int GC_CALLBACK GC_never_stop_func(void)
+GC_INNER int GC_CALLBACK GC_never_stop_func(void)
 {
   return(0);
 }
@@ -275,7 +275,7 @@ STATIC void GC_clear_a_few_frames(void)
 STATIC word GC_collect_at_heapsize = (word)(-1);
 
 /* Have we allocated enough to amortize a collection? */
-GC_bool GC_should_collect(void)
+GC_INNER GC_bool GC_should_collect(void)
 {
     static word last_min_bytes_allocd;
     static word last_gc_no;
@@ -372,7 +372,7 @@ STATIC void GC_maybe_gc(void)
  * not GC_never_stop_func then abort if stop_func returns TRUE.
  * Return TRUE if we successfully completed the collection.
  */
-GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
+GC_INNER GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
 {
 #   ifndef SMALL_CONFIG
       CLOCK_TYPE start_time = 0; /* initialized to prevent warning. */
@@ -462,7 +462,7 @@ GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
 STATIC int GC_deficit = 0;/* The number of extra calls to GC_mark_some  */
                           /* that we have made.                         */
 
-void GC_collect_a_little_inner(int n)
+GC_INNER void GC_collect_a_little_inner(int n)
 {
     int i;
     IF_CANCEL(int cancel_state;)
@@ -520,11 +520,11 @@ GC_API int GC_CALL GC_collect_a_little(void)
 }
 
 #if !defined(REDIRECT_MALLOC) && (defined(MSWIN32) || defined(MSWINCE))
-  void GC_add_current_malloc_heap(void);
+  GC_INNER void GC_add_current_malloc_heap(void);
 #endif
 
 #ifdef MAKE_BACK_GRAPH
-  void GC_build_back_graph(void);
+  GC_INNER void GC_build_back_graph(void);
 #endif
 
 #ifndef SMALL_CONFIG
@@ -652,7 +652,7 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func)
 }
 
 /* Set all mark bits for the free list whose first entry is q   */
-void GC_set_fl_marks(ptr_t q)
+GC_INNER void GC_set_fl_marks(ptr_t q)
 {
    struct hblk *h, *last_h;
    hdr *hhdr;
@@ -751,7 +751,7 @@ STATIC void GC_clear_fl_marks(ptr_t q)
 #endif
 
 #ifdef MAKE_BACK_GRAPH
-  void GC_traverse_back_graph(void);
+  GC_INNER void GC_traverse_back_graph(void);
 #endif
 
 /* Finish up a collection.  Assumes mark bits are consistent, lock is   */
@@ -976,7 +976,7 @@ GC_INNER word GC_n_heap_sects = 0;
 #ifdef USE_PROC_FOR_LIBRARIES
   /* Add HBLKSIZE aligned, GET_MEM-generated block to GC_our_memory. */
   /* Defined to do nothing if USE_PROC_FOR_LIBRARIES not set.       */
-  void GC_add_to_our_memory(ptr_t p, size_t bytes)
+  GC_INNER void GC_add_to_our_memory(ptr_t p, size_t bytes)
   {
     if (0 == p) return;
     if (GC_n_memory >= MAX_HEAP_SECTS)
@@ -991,7 +991,7 @@ GC_INNER word GC_n_heap_sects = 0;
  * Use the chunk of memory starting at p of size bytes as part of the heap.
  * Assumes p is HBLKSIZE aligned, and bytes is a multiple of HBLKSIZE.
  */
-void GC_add_to_heap(struct hblk *p, size_t bytes)
+GC_INNER void GC_add_to_heap(struct hblk *p, size_t bytes)
 {
     hdr * phdr;
     word endp;
@@ -1089,7 +1089,7 @@ GC_word GC_max_retries = 0;
  * Tiny values of n are rounded up.
  * Returns FALSE on failure.
  */
-GC_bool GC_expand_hp_inner(word n)
+GC_INNER GC_bool GC_expand_hp_inner(word n)
 {
     word bytes;
     struct hblk * space;
@@ -1181,8 +1181,9 @@ GC_INNER unsigned GC_fail_count = 0;
 /* free blocks available.  Should be called until the blocks are        */
 /* available (seting retry value to TRUE unless this is the first call  */
 /* in a loop) or until it fails by returning FALSE.                     */
-GC_bool GC_collect_or_expand(word needed_blocks, GC_bool ignore_off_page,
-                             GC_bool retry)
+GC_INNER GC_bool GC_collect_or_expand(word needed_blocks,
+                                      GC_bool ignore_off_page,
+                                      GC_bool retry)
 {
     GC_bool gc_not_stopped = TRUE;
     word blocks_to_get;
@@ -1256,7 +1257,7 @@ GC_bool GC_collect_or_expand(word needed_blocks, GC_bool ignore_off_page,
  * The object MUST BE REMOVED FROM THE FREE LIST BY THE CALLER.
  * Assumes we hold the allocator lock.
  */
-ptr_t GC_allocobj(size_t gran, int kind)
+GC_INNER ptr_t GC_allocobj(size_t gran, int kind)
 {
     void ** flh = &(GC_obj_kinds[kind].ok_freelist[gran]);
     GC_bool tried_minor = FALSE;
index 36e19dc..c2e2e29 100644 (file)
@@ -231,8 +231,8 @@ static void add_edge(ptr_t p, ptr_t q)
 
     GC_ASSERT(p == GC_base(p) && q == GC_base(q));
     if (!GC_HAS_DEBUG_INFO(q) || !GC_HAS_DEBUG_INFO(p)) {
-      /* This is really a misinterpreted free list link, since we saw */
-      /* a pointer to a free list.  Dont overwrite it!                */
+      /* This is really a misinterpreted free list link, since we saw   */
+      /* a pointer to a free list.  Don't overwrite it!                 */
       return;
     }
     if (0 == old_back_ptr) {
@@ -344,7 +344,7 @@ static void add_back_edges(ptr_t p, size_t n_bytes, word gc_descr)
 
 /* Rebuild the representation of the backward reachability graph.       */
 /* Does not examine mark bits.  Can be called before GC.                */
-void GC_build_back_graph(void)
+GC_INNER void GC_build_back_graph(void)
 {
   GC_apply_to_each_object(add_back_edges);
 }
@@ -450,7 +450,7 @@ static void update_max_height(ptr_t p, size_t n_bytes, word gc_descr)
 
 STATIC word GC_max_max_height = 0;
 
-void GC_traverse_back_graph(void)
+GC_INNER void GC_traverse_back_graph(void)
 {
   GC_max_height = 0;
   GC_apply_to_each_object(update_max_height);
@@ -476,4 +476,4 @@ void GC_print_back_graph_stats(void)
   GC_deepest_obj = 0;
 }
 
-#endif /* !MAKE_BACK_GRAPH */
+#endif /* MAKE_BACK_GRAPH */
index 80583a4..25ebea8 100644 (file)
@@ -54,7 +54,7 @@ GC_INNER word GC_black_list_spacing = MINHINCR * HBLKSIZE;
 
 STATIC void GC_clear_bl(word *);
 
-void GC_default_print_heap_obj_proc(ptr_t p)
+GC_INNER void GC_default_print_heap_obj_proc(ptr_t p)
 {
     ptr_t base = GC_base(p);
     GC_err_printf("start: %p, appr. length: %ld", base,
@@ -83,7 +83,7 @@ STATIC void GC_print_source_ptr(ptr_t p)
 }
 #endif
 
-void GC_bl_init(void)
+GC_INNER void GC_bl_init(void)
 {
     if (!GC_all_interior_pointers) {
       GC_old_normal_bl = (word *)
@@ -122,7 +122,7 @@ static word total_stack_black_listed(void);
 
 /* Signal the completion of a collection.  Turn the incomplete black    */
 /* lists into new black lists, etc.                                     */
-void GC_promote_black_lists(void)
+GC_INNER void GC_promote_black_lists(void)
 {
     word * very_old_normal_bl = GC_old_normal_bl;
     word * very_old_stack_bl = GC_old_stack_bl;
@@ -155,7 +155,7 @@ void GC_promote_black_lists(void)
     }
 }
 
-void GC_unpromote_black_lists(void)
+GC_INNER void GC_unpromote_black_lists(void)
 {
     if (!GC_all_interior_pointers) {
       GC_copy_bl(GC_old_normal_bl, GC_incomplete_normal_bl);
@@ -167,9 +167,9 @@ void GC_unpromote_black_lists(void)
 /* the plausible heap bounds.                                   */
 /* Add it to the normal incomplete black list if appropriate.   */
 #ifdef PRINT_BLACK_LIST
-  void GC_add_to_black_list_normal(word p, ptr_t source)
+  GC_INNER void GC_add_to_black_list_normal(word p, ptr_t source)
 #else
-  void GC_add_to_black_list_normal(word p)
+  GC_INNER void GC_add_to_black_list_normal(word p)
 #endif
 {
     if (!(GC_modws_valid_offsets[p & (sizeof(word)-1)])) return;
@@ -194,9 +194,9 @@ void GC_unpromote_black_lists(void)
 
 /* And the same for false pointers from the stack. */
 #ifdef PRINT_BLACK_LIST
-  void GC_add_to_black_list_stack(word p, ptr_t source)
+  GC_INNER void GC_add_to_black_list_stack(word p, ptr_t source)
 #else
-  void GC_add_to_black_list_stack(word p)
+  GC_INNER void GC_add_to_black_list_stack(word p)
 #endif
 {
     word index = PHT_HASH((word)p);
@@ -223,7 +223,7 @@ void GC_unpromote_black_lists(void)
  * If (h,len) is not black listed, return 0.
  * Knows about the structure of the black list hash tables.
  */
-struct hblk * GC_is_black_listed(struct hblk *h, word len)
+GC_INNER struct hblk * GC_is_black_listed(struct hblk *h, word len)
 {
     word index = PHT_HASH((word)h);
     word i;
index d6a745e..5194af2 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifdef DARWIN_DONT_PARSE_STACK
 
-void GC_push_all_stacks(void)
+GC_INNER void GC_push_all_stacks(void)
 {
   int i;
   kern_return_t r;
@@ -233,7 +233,7 @@ static unsigned long FindTopOfStack(unsigned long stack_start)
   return (unsigned long)frame;
 }
 
-void GC_push_all_stacks(void)
+GC_INNER void GC_push_all_stacks(void)
 {
   unsigned int i;
   task_t my_task;
@@ -415,7 +415,7 @@ STATIC int GC_use_mach_handler_thread = 0;
 static struct GC_mach_thread GC_mach_threads[THREAD_TABLE_SZ];
 STATIC int GC_mach_threads_count = 0;
 
-void GC_stop_init(void)
+GC_INNER void GC_stop_init(void)
 {
   int i;
 
@@ -509,12 +509,12 @@ STATIC int GC_suspend_thread_list(thread_act_array_t act_list, int count,
 }
 
 #ifdef MPROTECT_VDB
-  void GC_mprotect_stop(void);
-  void GC_mprotect_resume(void);
+  GC_INNER void GC_mprotect_stop(void);
+  GC_INNER void GC_mprotect_resume(void);
 #endif
 
 /* Caller holds allocation lock.        */
-void GC_stop_world(void)
+GC_INNER void GC_stop_world(void)
 {
     unsigned int i, changes;
     task_t my_task = current_task();
@@ -602,7 +602,7 @@ void GC_stop_world(void)
 
 /* Caller holds allocation lock, and has held it continuously since     */
 /* the world stopped.                                                   */
-void GC_start_world(void)
+GC_INNER void GC_start_world(void)
 {
   task_t my_task = current_task();
   mach_port_t my_thread = mach_thread_self();
index 9f8f2c1..1a7d0f2 100644 (file)
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -22,7 +22,7 @@
 #endif
 #include <string.h>
 
-void GC_default_print_heap_obj_proc(ptr_t p);
+GC_INNER void GC_default_print_heap_obj_proc(ptr_t p);
 
 GC_API void GC_CALL GC_register_finalizer_no_order(void * obj,
                                 GC_finalization_proc fn, void * cd,
@@ -38,7 +38,7 @@ GC_API void GC_CALL GC_register_finalizer_no_order(void * obj,
   /* on free lists may not have debug information set.  Thus it's */
   /* not always safe to return TRUE, even if the client does      */
   /* its part.                                                    */
-  GC_bool GC_has_other_debug_info(ptr_t p)
+  GC_INNER GC_bool GC_has_other_debug_info(ptr_t p)
   {
     oh * ohdr = (oh *)p;
     ptr_t body = (ptr_t)(ohdr + 1);
@@ -77,14 +77,14 @@ GC_API void GC_CALL GC_register_finalizer_no_order(void * obj,
   /* small, and this shouldn't be used in production code.                 */
   /* We assume that dest is the real base pointer.  Source will usually    */
   /* be a pointer to the interior of an object.                            */
-  void GC_store_back_pointer(ptr_t source, ptr_t dest)
+  GC_INNER void GC_store_back_pointer(ptr_t source, ptr_t dest)
   {
     if (GC_HAS_DEBUG_INFO(dest)) {
       ((oh *)dest) -> oh_back_ptr = HIDE_BACK_PTR(source);
     }
   }
 
-  void GC_marked_for_finalization(ptr_t dest)
+  GC_INNER void GC_marked_for_finalization(ptr_t dest)
   {
     GC_store_back_pointer(MARKED_FOR_FINALIZATION, dest);
   }
@@ -226,7 +226,7 @@ GC_API void GC_CALL GC_register_finalizer_no_order(void * obj,
 
   /* Force a garbage collection and generate a backtrace from a */
   /* random heap address.                                       */
-  void GC_generate_random_backtrace_no_gc(void)
+  GC_INNER void GC_generate_random_backtrace_no_gc(void)
   {
     void * current;
     current = GC_generate_random_valid_address();
@@ -250,7 +250,8 @@ GC_API void GC_CALL GC_register_finalizer_no_order(void * obj,
         (((word)(p + sizeof(oh) + sz - 1) ^ (word)p) >= HBLKSIZE)
 /* Store debugging info into p.  Return displaced pointer. */
 /* Assumes we don't hold allocation lock.                  */
-ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string, word integer)
+GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string,
+                                   word integer)
 {
     word * result = (word *)((oh *)p + 1);
     DCL_LOCK_STATE;
@@ -443,7 +444,7 @@ STATIC void GC_debug_print_heap_obj_proc(ptr_t p)
   STATIC void GC_do_nothing(void) {}
 #endif
 
-void GC_start_debugging(void)
+GC_INNER void GC_start_debugging(void)
 {
 #   ifndef SHORT_DBG_HDRS
       GC_check_heap = GC_check_heap_proc;
@@ -530,7 +531,7 @@ GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb,
    * We assume debugging was started in collector initialization,
    * and we already hold the GC lock.
    */
-  void * GC_debug_generic_malloc_inner(size_t lb, int k)
+  GC_INNER void * GC_debug_generic_malloc_inner(size_t lb, int k)
   {
     void * result = GC_generic_malloc_inner(lb + DEBUG_BYTES, k);
 
@@ -543,7 +544,8 @@ GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb,
     return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0));
   }
 
-  void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb, int k)
+  GC_INNER void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb,
+                                                                int k)
   {
     void * result = GC_generic_malloc_inner_ignore_off_page(
                                                 lb + DEBUG_BYTES, k);
@@ -666,7 +668,8 @@ GC_API char * GC_CALL GC_debug_strdup(const char *str, GC_EXTRA_PARAMS)
     return copy;
 }
 
-GC_API void * GC_CALL GC_debug_malloc_uncollectable(size_t lb, GC_EXTRA_PARAMS)
+GC_API void * GC_CALL GC_debug_malloc_uncollectable(size_t lb,
+                                                    GC_EXTRA_PARAMS)
 {
     void * result = GC_malloc_uncollectable(lb + UNCOLLECTABLE_DEBUG_BYTES);
 
@@ -766,7 +769,7 @@ GC_API void GC_CALL GC_debug_free(void * p)
 
 #if defined(THREADS) && defined(DBG_HDRS_ALL)
   /* Used internally; we assume it's called correctly.    */
-  void GC_debug_free_inner(void * p)
+  GC_INNER void GC_debug_free_inner(void * p)
   {
     ptr_t base = GC_base(p);
     GC_ASSERT((ptr_t)p - (ptr_t)base == sizeof(oh));
index 5e72edc..dcea97c 100644 (file)
@@ -67,8 +67,7 @@ GC_DLL          Defined by user if dynamic libraries are being built
                 be taken to properly deal with statically allocated
                 variables in the main program.  Used for MS Windows.
                 Also used by GCC v4+ (only when the dynamic shared library
-                is being built) in conjunction with "-fvisibility=hidden"
-                option to hide internally used symbols.
+                is being built) to hide internally used symbols.
 
 GC_NOT_DLL      User-settable macro that overrides _DLL, e.g. if runtime
                 dynamic libraries are used, but the collector is in a static
@@ -452,8 +451,7 @@ STATIC=static   Causes various GC_ symbols that could logically be declared
 
 GC_DLL  Build dynamic-link library (or dynamic shared object).  For Unix this
   causes the exported symbols to have 'default' visibility (ignored unless
-  GCC v4+, meaningful only if used together with GCC -fvisibility=hidden
-  option).
+  GCC v4+) and the internal ones to have 'hidden' visibility.
 
 DONT_USE_USER32_DLL (Win32 only)        Don't use "user32" DLL import library
   (containing MessageBox() entry); useful for a static GC library.
@@ -471,7 +469,7 @@ GC_IGNORE_GCJ_INFO      Disable GCJ-style type information (useful for
 GC_PRINT_VERBOSE_STATS  Permanently turn on verbose logging (useful for
   debugging and profiling on WinCE).
 
-GC_DONT_EXPAND  Dont expand the heap unless explicitly requested or forced to.
+GC_DONT_EXPAND  Don't expand the heap unless explicitly requested or forced to.
 
 GC_INITIAL_HEAP_SIZE=<value>    Set the desired default initial heap size
   in bytes.
index 89edcaf..89874dd 100644 (file)
@@ -176,7 +176,7 @@ GC_FirstDLOpenedLinkMap(void)
 # endif
 
 # ifndef USE_PROC_FOR_LIBRARIES
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
   struct link_map *lm = GC_FirstDLOpenedLinkMap();
 
@@ -230,10 +230,10 @@ void GC_register_dynamic_libraries(void)
 
 #define MAPS_BUF_SIZE (32*1024)
 
-char *GC_parse_map_entry(char *buf_ptr, ptr_t *start, ptr_t *end,
+GC_INNER char *GC_parse_map_entry(char *buf_ptr, ptr_t *start, ptr_t *end,
                                   char **prot, unsigned int *maj_dev,
                                   char **mapping_name);
-char *GC_get_maps(void); /* from os_dep.c */
+GC_INNER char *GC_get_maps(void); /* from os_dep.c */
 
 /* Sort an array of HeapSects by start address.                         */
 /* Unfortunately at least some versions of                              */
@@ -266,7 +266,7 @@ static void sort_heap_sects(struct HeapSect *base, size_t number_of_elements)
 }
 
 #ifdef THREADS
-  GC_bool GC_segment_is_thread_stack(ptr_t lo, ptr_t hi);
+  GC_INNER GC_bool GC_segment_is_thread_stack(ptr_t lo, ptr_t hi);
 #endif
 
 STATIC word GC_register_map_entries(char *maps)
@@ -356,14 +356,14 @@ STATIC word GC_register_map_entries(char *maps)
     return 1;
 }
 
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
     if (!GC_register_map_entries(GC_get_maps()))
         ABORT("Failed to read /proc for library registration.");
 }
 
 /* We now take care of the main data segment ourselves: */
-GC_bool GC_register_main_static_data(void)
+GC_INNER GC_bool GC_register_main_static_data(void)
 {
     return FALSE;
 }
@@ -542,7 +542,7 @@ STATIC GC_bool GC_register_dynamic_libraries_dl_iterate_phdr(void)
 }
 
 /* Do we need to separately register the main static data segment? */
-GC_bool GC_register_main_static_data(void)
+GC_INNER GC_bool GC_register_main_static_data(void)
 {
   return (dl_iterate_phdr == 0);
 }
@@ -606,7 +606,7 @@ GC_FirstDLOpenedLinkMap(void)
     return cachedResult;
 }
 
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
   struct link_map *lm;
 
@@ -660,14 +660,14 @@ void GC_register_dynamic_libraries(void)
 # define IRIX6
 #endif
 
-void * GC_roots_present(ptr_t);
+GC_INNER void * GC_roots_present(ptr_t);
         /* The type is a lie, since the real type doesn't make sense here, */
         /* and we only test for NULL.                                      */
 
 /* We use /proc to track down all parts of the address space that are   */
 /* mapped by the process, and throw out regions we know we shouldn't    */
 /* worry about.  This may also work under other SVR4 variants.          */
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
     static int fd = -1;
     char buf[30];
@@ -788,10 +788,11 @@ void GC_register_dynamic_libraries(void)
   /* We traverse the entire address space and register all segments     */
   /* that could possibly have been written to.                          */
 
-  GC_bool GC_is_heap_base(ptr_t p);
+  GC_INNER GC_bool GC_is_heap_base(ptr_t p);
 
 # ifdef GC_WIN32_THREADS
-    void GC_get_next_stack(char *start, char * limit, char **lo, char **hi);
+    GC_INNER void GC_get_next_stack(char *start, char * limit, char **lo,
+                                    char **hi);
 
     STATIC void GC_cond_add_roots(char *base, char * limit)
     {
@@ -825,7 +826,8 @@ void GC_register_dynamic_libraries(void)
 # endif
 
 #ifdef DYNAMIC_LOADING
-  GC_bool GC_register_main_static_data(void)
+  /* GC_register_main_static_data is not needed unless DYNAMIC_LOADING. */
+  GC_INNER GC_bool GC_register_main_static_data(void)
   {
 #   ifdef MSWINCE
       /* Do we need to separately register the main static data segment? */
@@ -861,7 +863,7 @@ void GC_register_dynamic_libraries(void)
 #   define GC_wnt TRUE
 # endif
 
-  void GC_register_dynamic_libraries(void)
+  GC_INNER void GC_register_dynamic_libraries(void)
   {
     MEMORY_BASIC_INFORMATION buf;
     size_t result;
@@ -927,7 +929,7 @@ void GC_register_dynamic_libraries(void)
 
 #include <loader.h>
 
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
   int status;
   ldr_process_t mypid;
@@ -1035,7 +1037,7 @@ void GC_register_dynamic_libraries(void)
 extern char *sys_errlist[];
 extern int sys_nerr;
 
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
   int status;
   int index = 1; /* Ordinal position in shared library search list */
@@ -1093,7 +1095,7 @@ void GC_register_dynamic_libraries(void)
 # pragma alloca
 # include <sys/ldr.h>
 # include <sys/errno.h>
-  void GC_register_dynamic_libraries(void)
+  GC_INNER void GC_register_dynamic_libraries(void)
   {
         int len;
         char *ldibuf;
@@ -1214,7 +1216,7 @@ STATIC void GC_dyld_image_remove(const struct GC_MACH_HEADER *hdr,
 #   endif
 }
 
-void GC_register_dynamic_libraries(void)
+GC_INNER void GC_register_dynamic_libraries(void)
 {
     /* Currently does nothing. The callbacks are setup by GC_init_dyld()
     The dyld library takes it from there. */
@@ -1226,7 +1228,7 @@ void GC_register_dynamic_libraries(void)
    This should be called BEFORE any thread in created and WITHOUT the
    allocation lock held. */
 
-void GC_init_dyld(void)
+GC_INNER void GC_init_dyld(void)
 {
   static GC_bool initialized = FALSE;
 
@@ -1269,7 +1271,7 @@ void GC_init_dyld(void)
 }
 
 #define HAVE_REGISTER_MAIN_STATIC_DATA
-GC_bool GC_register_main_static_data(void)
+GC_INNER GC_bool GC_register_main_static_data(void)
 {
   /* Already done through dyld callbacks */
   return FALSE;
@@ -1285,7 +1287,7 @@ GC_bool GC_register_main_static_data(void)
 # include "th/PCR_ThCtl.h"
 # include "mm/PCR_MM.h"
 
-  void GC_register_dynamic_libraries(void)
+  GC_INNER void GC_register_dynamic_libraries(void)
   {
     /* Add new static data areas of dynamically loaded modules. */
         {
@@ -1317,7 +1319,7 @@ GC_bool GC_register_main_static_data(void)
 
 #else /* !PCR */
 
-void GC_register_dynamic_libraries(void) {}
+GC_INNER void GC_register_dynamic_libraries(void) {}
 
 #endif /* !PCR */
 
@@ -1325,7 +1327,7 @@ void GC_register_dynamic_libraries(void) {}
 
 #ifndef HAVE_REGISTER_MAIN_STATIC_DATA
   /* Do we need to separately register the main static data segment? */
-  GC_bool GC_register_main_static_data(void)
+  GC_INNER GC_bool GC_register_main_static_data(void)
   {
     return TRUE;
   }
index 8367053..04521c1 100644 (file)
@@ -83,7 +83,7 @@ static signed_word log_fo_table_size = -1;
 
 word GC_fo_entries = 0; /* used also in extra/MacOS.c */
 
-void GC_push_finalizer_structures(void)
+GC_INNER void GC_push_finalizer_structures(void)
 {
     GC_push_all((ptr_t)(&dl_head), (ptr_t)(&dl_head) + sizeof(word));
     GC_push_all((ptr_t)(&fo_head), (ptr_t)(&fo_head) + sizeof(word));
@@ -494,8 +494,8 @@ GC_API void GC_CALL GC_register_finalizer_unreachable(void * obj,
 #ifdef THREADS
   /* Defined in pthread_support.c or win32_threads.c.  Called with the  */
   /* allocation lock held.                                              */
-  void GC_reset_finalizer_nested(void);
-  unsigned *GC_check_finalizer_nested(void);
+  GC_INNER void GC_reset_finalizer_nested(void);
+  GC_INNER unsigned *GC_check_finalizer_nested(void);
 #else
   /* Global variables to minimize the level of recursion when a client  */
   /* finalizer allocates memory.                                        */
@@ -524,7 +524,7 @@ GC_API void GC_CALL GC_register_finalizer_unreachable(void * obj,
 /* Called with held lock (but the world is running).                    */
 /* Cause disappearing links to disappear and unreachable objects to be  */
 /* enqueued for finalization.                                           */
-void GC_finalize(void)
+GC_INNER void GC_finalize(void)
 {
     struct disappearing_link * curr_dl, * prev_dl, * next_dl;
     struct finalizable_object * curr_fo, * prev_fo, * next_fo;
@@ -839,7 +839,7 @@ GC_finalizer_notifier_proc GC_finalizer_notifier =
 
 static GC_word last_finalizer_notification = 0;
 
-void GC_notify_or_invoke_finalizers(void)
+GC_INNER void GC_notify_or_invoke_finalizers(void)
 {
     GC_finalizer_notifier_proc notifier_fn = 0;
 #   if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
@@ -929,7 +929,7 @@ GC_API void * GC_CALL GC_call_with_alloc_lock(GC_fn_type fn,
 }
 
 #ifndef SMALL_CONFIG
-  void GC_print_finalization_stats(void)
+  GC_INNER void GC_print_finalization_stats(void)
   {
     struct finalizable_object *fo = GC_finalize_now;
     unsigned long ready = 0;
index b9b1aa4..6077a03 100644 (file)
--- a/gcj_mlc.c
+++ b/gcj_mlc.c
@@ -151,7 +151,8 @@ static void maybe_finalize(void)
 /* type structure (vtable in gcj).                              */
 /* This adds a byte at the end of the object if GC_malloc would.*/
 #ifdef THREAD_LOCAL_ALLOC
-  void * GC_core_gcj_malloc(size_t lb, void * ptr_to_struct_containing_descr)
+  GC_INNER void * GC_core_gcj_malloc(size_t lb,
+                                     void * ptr_to_struct_containing_descr)
 #else
   GC_API void * GC_CALL GC_gcj_malloc(size_t lb,
                                       void * ptr_to_struct_containing_descr)
@@ -197,7 +198,7 @@ static void maybe_finalize(void)
     return((void *) op);
 }
 
-void GC_start_debugging(void);
+GC_INNER void GC_start_debugging(void);
 
 /* Similar to GC_gcj_malloc, but add debug info.  This is allocated     */
 /* with GC_gcj_debug_kind.                                              */
index 8a70852..1f8a7c9 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -33,7 +33,7 @@ STATIC bottom_index * GC_all_bottom_indices_end = 0;
                                 /* bottom_index.                  */
 
 /* Non-macro version of header location routine */
-hdr * GC_find_header(ptr_t h)
+GC_INNER hdr * GC_find_header(ptr_t h)
 {
 #   ifdef HASH_TL
         hdr * result;
@@ -51,10 +51,11 @@ hdr * GC_find_header(ptr_t h)
 /* of an object unless both GC_all_interior_pointers is set     */
 /* and p is in fact a valid object pointer.                     */
 /* Never returns a pointer to a free hblk.                      */
+GC_INNER hdr *
 #ifdef PRINT_BLACK_LIST
-  hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce, ptr_t source)
+  GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce, ptr_t source)
 #else
-  hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce)
+  GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce)
 #endif
 {
   hdr *hhdr;
@@ -114,7 +115,7 @@ static ptr_t scratch_free_ptr = 0;
 /* GC_scratch_last_end_ptr is end point of last obtained scratch area.  */
 /* GC_scratch_end_ptr is end point of current scratch area.             */
 
-ptr_t GC_scratch_alloc(size_t bytes)
+GC_INNER ptr_t GC_scratch_alloc(size_t bytes)
 {
     register ptr_t result = scratch_free_ptr;
 
@@ -190,7 +191,7 @@ GC_INLINE void free_hdr(hdr * hhdr)
   word GC_hdr_cache_misses = 0;
 #endif
 
-void GC_init_headers(void)
+GC_INNER void GC_init_headers(void)
 {
     register unsigned i;
 
@@ -254,7 +255,7 @@ static GC_bool get_index(word addr)
 /* Install a header for block h.        */
 /* The header is uninitialized.         */
 /* Returns the header or 0 on failure.  */
-struct hblkhdr * GC_install_header(struct hblk *h)
+GC_INNER struct hblkhdr * GC_install_header(struct hblk *h)
 {
     hdr * result;
 
@@ -268,7 +269,7 @@ struct hblkhdr * GC_install_header(struct hblk *h)
 }
 
 /* Set up forwarding counts for block h of size sz */
-GC_bool GC_install_counts(struct hblk *h, size_t sz/* bytes */)
+GC_INNER GC_bool GC_install_counts(struct hblk *h, size_t sz/* bytes */)
 {
     struct hblk * hbp;
     word i;
@@ -285,20 +286,18 @@ GC_bool GC_install_counts(struct hblk *h, size_t sz/* bytes */)
 }
 
 /* Remove the header for block h */
-void GC_remove_header(struct hblk *h)
+GC_INNER void GC_remove_header(struct hblk *h)
 {
-    hdr ** ha;
-
+    hdr **ha;
     GET_HDR_ADDR(h, ha);
     free_hdr(*ha);
     *ha = 0;
 }
 
 /* Remove forwarding counts for h */
-void GC_remove_counts(struct hblk *h, size_t sz/* bytes */)
+GC_INNER void GC_remove_counts(struct hblk *h, size_t sz/* bytes */)
 {
     register struct hblk * hbp;
-
     for (hbp = h+1; (char *)hbp < (char *)h + sz; hbp += 1) {
         SET_HDR(hbp, 0);
     }
@@ -334,7 +333,7 @@ void GC_apply_to_all_blocks(void (*fn)(struct hblk *h, word client_data),
 
 /* Get the next valid block whose address is at least h */
 /* Return 0 if there is none.                           */
-struct hblk * GC_next_used_block(struct hblk *h)
+GC_INNER struct hblk * GC_next_used_block(struct hblk *h)
 {
     register bottom_index * bi;
     register word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1);
@@ -370,7 +369,7 @@ struct hblk * GC_next_used_block(struct hblk *h)
 /* Get the last (highest address) block whose address is        */
 /* at most h.  Return 0 if there is none.                       */
 /* Unlike the above, this may return a free block.              */
-struct hblk * GC_prev_block(struct hblk *h)
+GC_INNER struct hblk * GC_prev_block(struct hblk *h)
 {
     register bottom_index * bi;
     register signed_word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1);
index 42d2534..45dc181 100644 (file)
@@ -123,13 +123,13 @@ typedef struct {
 /* to stderr.  It requires that we do not hold the lock.        */
 #if defined(SAVE_CALL_CHAIN)
     struct callinfo;
-    void GC_save_callers(struct callinfo info[NFRAMES]);
-    void GC_print_callers(struct callinfo info[NFRAMES]);
+    GC_INNER void GC_save_callers(struct callinfo info[NFRAMES]);
+    GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]);
 #   define ADD_CALL_CHAIN(base, ra) GC_save_callers(((oh *)(base)) -> oh_ci)
 #   define PRINT_CALL_CHAIN(base) GC_print_callers(((oh *)(base)) -> oh_ci)
 #elif defined(GC_ADD_CALLER)
     struct callinfo;
-    void GC_print_callers(struct callinfo info[NFRAMES]);
+    GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]);
 #   define ADD_CALL_CHAIN(base, ra) ((oh *)(base)) -> oh_ci[0].ci_pc = (ra)
 #   define PRINT_CALL_CHAIN(base) GC_print_callers(((oh *)(base)) -> oh_ci)
 #else
@@ -150,7 +150,7 @@ typedef struct {
 #ifdef SHORT_DBG_HDRS
 # define GC_has_other_debug_info(p) TRUE
 #else
-  GC_bool GC_has_other_debug_info(ptr_t p);
+  GC_INNER GC_bool GC_has_other_debug_info(ptr_t p);
 #endif
 
 #if defined(KEEP_BACK_PTRS) || defined(MAKE_BACK_GRAPH)
@@ -162,6 +162,7 @@ typedef struct {
 
 /* Store debugging info into p.  Return displaced pointer. */
 /* Assumes we don't hold allocation lock.                  */
-ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str, word integer);
+GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
+                                   word integer);
 
 #endif /* _DBG_MLC_H */
index 86b5fbc..c5cf27f 100644 (file)
@@ -86,11 +86,12 @@ typedef struct hblkhdr hdr;
 # define HCE_HDR(h) ((hce) -> hce_hdr)
 
 #ifdef PRINT_BLACK_LIST
-  hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce, ptr_t source);
+  GC_INNER hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce,
+                                      ptr_t source);
 # define HEADER_CACHE_MISS(p, hce, source) \
           GC_header_cache_miss(p, hce, source)
 #else
-  hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce);
+  GC_INNER hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce);
 # define HEADER_CACHE_MISS(p, hce, source) GC_header_cache_miss(p, hce)
 #endif
 
index c8c593a..0a8162c 100644 (file)
@@ -24,7 +24,7 @@
  * DCL_LOCK_STATE declares any local variables needed by LOCK and UNLOCK.
  *
  * Note that I_HOLD_LOCK and I_DONT_HOLD_LOCK are used only positively
- * in assertions, and may return TRUE in the "dont know" case.
+ * in assertions, and may return TRUE in the "don't know" case.
  */
 # ifdef THREADS
 
       /* significant wasted time.  We thus rely mostly on queued locks. */
 #     define USE_SPIN_LOCK
       GC_EXTERN volatile AO_TS_t GC_allocate_lock;
-      void GC_lock(void);
+      GC_INNER void GC_lock(void);
         /* Allocation lock holder.  Only set if acquired by client through */
         /* GC_call_with_alloc_lock.                                        */
 #     ifdef GC_ASSERTIONS
      GC_EXTERN volatile GC_bool GC_collecting;
 #    define ENTER_GC() GC_collecting = 1;
 #    define EXIT_GC() GC_collecting = 0;
-     void GC_lock(void);
+     GC_INNER void GC_lock(void);
      GC_EXTERN unsigned long GC_lock_holder;
 #    ifdef GC_ASSERTIONS
        GC_EXTERN unsigned long GC_mark_lock_holder;
index 22bc08a..c0232cc 100644 (file)
@@ -129,7 +129,7 @@ GC_EXTERN mse * GC_mark_stack;
      */
 #endif /* PARALLEL_MARK */
 
-mse * GC_signal_mark_stack_overflow(mse *msp);
+GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp);
 
 /* Push the object obj with corresponding heap block header hhdr onto   */
 /* the mark stack.                                                      */
@@ -420,7 +420,7 @@ exit_label: ; \
 /* mark stack entry bottom (incl.).  Stop after performing      */
 /* about one page worth of work.  Return the new mark stack     */
 /* top entry.                                                   */
-mse * GC_mark_from(mse * top, mse * bottom, mse *limit);
+GC_INNER mse * GC_mark_from(mse * top, mse * bottom, mse *limit);
 
 #define MARK_FROM_MARK_STACK() \
         GC_mark_stack_top = GC_mark_from(GC_mark_stack_top, \
index cbe39bb..c9a0e61 100644 (file)
@@ -92,7 +92,12 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
 
 #ifndef GC_INNER
   /* This tagging macro must be used at the start of every variable     */
-  /* definition which is declared with GC_EXTERN.                       */
+  /* definition which is declared with GC_EXTERN.  Should be also used  */
+  /* for the GC-scope function definitions and prototypes.  Must not be */
+  /* used in gcconfig.h.  Shouldn't be used for the debugging-only      */
+  /* functions.  Currently, not used for the functions declared in or   */
+  /* called from the "dated" source files (pcr_interface.c, specific.c  */
+  /* and in the "extra" folder).                                        */
 # if defined(GC_DLL) && defined(__GNUC__) && !defined(MSWIN32) \
         && !defined(MSWINCE)
 #   if __GNUC__ >= 4
@@ -264,8 +269,8 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
 #ifdef SAVE_CALL_CHAIN
   /* Fill in the pc and argument information for up to NFRAMES of my    */
   /* callers.  Ignore my frame and my callers frame.                    */
-  void GC_save_callers(struct callinfo info[NFRAMES]);
-  void GC_print_callers(struct callinfo info[NFRAMES]);
+  GC_INNER void GC_save_callers(struct callinfo info[NFRAMES]);
+  GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]);
 #endif
 
 
@@ -368,8 +373,8 @@ typedef char * ptr_t;   /* A generic pointer to which we can add        */
                                    PCR_waitForever);
 # else
 #   if defined(GC_WIN32_THREADS) || defined(GC_PTHREADS)
-      void GC_stop_world(void);
-      void GC_start_world(void);
+      GC_INNER void GC_stop_world(void);
+      GC_INNER void GC_start_world(void);
 #     define STOP_WORLD() GC_stop_world()
 #     define START_WORLD() GC_start_world()
 #   else
@@ -1333,7 +1338,7 @@ struct GC_activation_frame_s {
 #ifdef THREADS
 /* Process all activation "frames" - scan entire stack except for       */
 /* frames belonging to the user functions invoked by GC_do_blocking().  */
-  void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
+  GC_INNER void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
                         struct GC_activation_frame_s *activation_frame);
 #else
   GC_EXTERN ptr_t GC_blocked_sp;
@@ -1345,7 +1350,7 @@ struct GC_activation_frame_s {
 
 #ifdef IA64
   /* Similar to GC_push_all_stack_frames() but for IA-64 registers store. */
-  void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi,
+  GC_INNER void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi,
                    int eager, struct GC_activation_frame_s *activation_frame);
 #endif
 
@@ -1406,57 +1411,57 @@ struct GC_activation_frame_s {
 
 /* Important internal collector routines */
 
-ptr_t GC_approx_sp(void);
+GC_INNER ptr_t GC_approx_sp(void);
 
-GC_bool GC_should_collect(void);
+GC_INNER GC_bool GC_should_collect(void);
 
 void GC_apply_to_all_blocks(void (*fn)(struct hblk *h, word client_data),
                             word client_data);
                         /* Invoke fn(hbp, client_data) for each         */
                         /* allocated heap block.                        */
-struct hblk * GC_next_used_block(struct hblk * h);
+GC_INNER struct hblk * GC_next_used_block(struct hblk * h);
                         /* Return first in-use block >= h       */
-struct hblk * GC_prev_block(struct hblk * h);
+GC_INNER struct hblk * GC_prev_block(struct hblk * h);
                         /* Return last block <= h.  Returned block      */
                         /* is managed by GC, but may or may not be in   */
                         /* use.                                         */
-void GC_mark_init(void);
-void GC_clear_marks(void);
+GC_INNER void GC_mark_init(void);
+GC_INNER void GC_clear_marks(void);
                         /* Clear mark bits for all heap objects.        */
-void GC_invalidate_mark_state(void);
+GC_INNER void GC_invalidate_mark_state(void);
                                 /* Tell the marker that marked          */
                                 /* objects may point to unmarked        */
                                 /* ones, and roots may point to         */
                                 /* unmarked objects.  Reset mark stack. */
-GC_bool GC_mark_stack_empty(void);
-GC_bool GC_mark_some(ptr_t cold_gc_frame);
+GC_INNER GC_bool GC_mark_stack_empty(void);
+GC_INNER GC_bool GC_mark_some(ptr_t cold_gc_frame);
                         /* Perform about one pages worth of marking     */
                         /* work of whatever kind is needed.  Returns    */
                         /* quickly if no collection is in progress.     */
                         /* Return TRUE if mark phase finished.          */
-void GC_initiate_gc(void);
+GC_INNER void GC_initiate_gc(void);
                                 /* initiate collection.                 */
                                 /* If the mark state is invalid, this   */
                                 /* becomes full collection.  Otherwise  */
                                 /* it's partial.                        */
 
-GC_bool GC_collection_in_progress(void);
+GC_INNER GC_bool GC_collection_in_progress(void);
                         /* Collection is in progress, or was abandoned. */
 
-void GC_push_all(ptr_t bottom, ptr_t top);
+GC_INNER void GC_push_all(ptr_t bottom, ptr_t top);
                                 /* Push everything in a range           */
                                 /* onto mark stack.                     */
 #ifndef SMALL_CONFIG
-  void GC_push_conditional(ptr_t b, ptr_t t, GC_bool all);
+  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.                    */
-void GC_push_all_stack(ptr_t b, ptr_t t);
+GC_INNER void GC_push_all_stack(ptr_t b, ptr_t t);
                                     /* As above, but consider           */
                                     /*  interior pointers as valid      */
-void GC_push_all_eager(ptr_t b, ptr_t t);
+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    */
                                     /* immediately, not just scheduled  */
@@ -1468,7 +1473,7 @@ void GC_push_all_eager(ptr_t b, ptr_t t);
   /* stacks are scheduled for scanning in *GC_push_other_roots, which   */
   /* is thread-package-specific.                                        */
 
-void GC_push_roots(GC_bool all, ptr_t cold_gc_frame);
+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);
@@ -1479,7 +1484,7 @@ GC_EXTERN void (*GC_push_other_roots)(void);
                         /* supplied replacement should also call the    */
                         /* original function.                           */
 
-void GC_push_finalizer_structures(void);
+GC_INNER void GC_push_finalizer_structures(void);
 #ifdef THREADS
   void GC_push_thread_structures(void);
 #endif
@@ -1487,7 +1492,8 @@ GC_EXTERN void (*GC_push_typed_structures)(void);
                         /* A pointer such that we can avoid linking in  */
                         /* the typed allocation support if unused.      */
 
-void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), ptr_t arg);
+GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
+                                          ptr_t arg);
 
 #if defined(SPARC) || defined(IA64)
   /* Cause all stacked registers to be saved in memory.  Return a       */
@@ -1509,17 +1515,17 @@ void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), ptr_t arg);
 #endif
 
 #if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
-  void GC_mark_and_push_stack(ptr_t p, ptr_t source);
+  GC_INNER void GC_mark_and_push_stack(ptr_t p, ptr_t source);
                                 /* Ditto, omits plausibility test       */
 #else
-  void GC_mark_and_push_stack(ptr_t p);
+  GC_INNER void GC_mark_and_push_stack(ptr_t p);
 #endif
 
-void GC_clear_hdr_marks(hdr * hhdr);
+GC_INNER void GC_clear_hdr_marks(hdr * hhdr);
                                     /* Clear the mark bits in a header */
-void GC_set_hdr_marks(hdr * hhdr);
+GC_INNER void GC_set_hdr_marks(hdr * hhdr);
                                     /* Set the mark bits in a header */
-void GC_set_fl_marks(ptr_t p);
+GC_INNER void GC_set_fl_marks(ptr_t p);
                                     /* Set all mark bits associated with */
                                     /* a free list.                      */
 #ifdef GC_ASSERTIONS
@@ -1529,34 +1535,34 @@ void GC_set_fl_marks(ptr_t p);
                                     /* set.  Abort if not.              */
 #endif
 void GC_add_roots_inner(ptr_t b, ptr_t e, GC_bool tmp);
-void GC_exclude_static_roots_inner(void *start, void *finish);
-void GC_register_dynamic_libraries(void);
+GC_INNER void GC_exclude_static_roots_inner(void *start, void *finish);
+GC_INNER void GC_register_dynamic_libraries(void);
                 /* Add dynamic library data sections to the root set. */
-void GC_cond_register_dynamic_libraries(void);
+GC_INNER void GC_cond_register_dynamic_libraries(void);
                 /* Remove and reregister dynamic libraries if we're     */
                 /* configured to do that at each GC.                    */
 
 /* Machine dependent startup routines */
 ptr_t GC_get_main_stack_base(void);     /* Cold end of stack.           */
 #ifdef IA64
-  ptr_t GC_get_register_stack_base(void);
+  GC_INNER ptr_t GC_get_register_stack_base(void);
                                         /* Cold end of register stack.  */
 #endif
 void GC_register_data_segments(void);
 
 #ifdef THREADS
-  void GC_thr_init(void);
-  void GC_init_parallel(void);
+  GC_INNER void GC_thr_init(void);
+  GC_INNER void GC_init_parallel(void);
 #else
-  GC_bool GC_is_static_root(ptr_t p);
+  GC_INNER GC_bool GC_is_static_root(ptr_t p);
                 /* Is the address p in one of the registered static     */
                 /* root sections?                                       */
 #endif
 
 /* Black listing: */
-void GC_bl_init(void);
+GC_INNER void GC_bl_init(void);
 # ifdef PRINT_BLACK_LIST
-      void GC_add_to_black_list_normal(word p, ptr_t source);
+      GC_INNER void GC_add_to_black_list_normal(word p, ptr_t source);
                         /* Register bits as a possible future false     */
                         /* reference from the heap or static data       */
 #     define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \
@@ -1566,7 +1572,7 @@ void GC_bl_init(void);
                   GC_add_to_black_list_normal((word)(bits), (source)); \
                 }
 # else
-      void GC_add_to_black_list_normal(word p);
+      GC_INNER void GC_add_to_black_list_normal(word p);
 #     define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \
                 if (GC_all_interior_pointers) { \
                   GC_add_to_black_list_stack((word)(bits)); \
@@ -1576,52 +1582,53 @@ void GC_bl_init(void);
 # endif
 
 # ifdef PRINT_BLACK_LIST
-    void GC_add_to_black_list_stack(word p, ptr_t source);
+    GC_INNER void GC_add_to_black_list_stack(word p, ptr_t source);
 #   define GC_ADD_TO_BLACK_LIST_STACK(bits, source) \
             GC_add_to_black_list_stack((word)(bits), (source))
 # else
-    void GC_add_to_black_list_stack(word p);
+    GC_INNER void GC_add_to_black_list_stack(word p);
 #   define GC_ADD_TO_BLACK_LIST_STACK(bits, source) \
             GC_add_to_black_list_stack((word)(bits))
 # endif
-struct hblk * GC_is_black_listed(struct hblk * h, word len);
+GC_INNER struct hblk * GC_is_black_listed(struct hblk * h, word len);
                         /* If there are likely to be false references   */
                         /* to a block starting at h of the indicated    */
                         /* length, then return the next plausible       */
                         /* starting location for h that might avoid     */
                         /* these false references.                      */
-void GC_promote_black_lists(void);
+GC_INNER void GC_promote_black_lists(void);
                         /* Declare an end to a black listing phase.     */
-void GC_unpromote_black_lists(void);
+GC_INNER void GC_unpromote_black_lists(void);
                         /* Approximately undo the effect of the above.  */
                         /* This actually loses some information, but    */
                         /* only in a reasonably safe way.               */
 
-ptr_t GC_scratch_alloc(size_t bytes);
+GC_INNER ptr_t GC_scratch_alloc(size_t bytes);
                                 /* GC internal memory allocation for    */
                                 /* small objects.  Deallocation is not  */
                                 /* possible.                            */
 
 /* Heap block layout maps: */
-GC_bool GC_add_map_entry(size_t sz);
+GC_INNER GC_bool GC_add_map_entry(size_t sz);
                                 /* Add a heap block map for objects of  */
                                 /* size sz to obj_map.                  */
                                 /* Return FALSE on failure.             */
-void GC_register_displacement_inner(size_t offset);
+GC_INNER void GC_register_displacement_inner(size_t offset);
                                 /* Version of GC_register_displacement  */
                                 /* that assumes lock is already held.   */
 
-void GC_initialize_offsets(void);
+GC_INNER void GC_initialize_offsets(void);
                                 /* Initialize GC_valid_offsets,         */
                                 /* depending on current                 */
                                 /* GC_all_interior_pointers settings.   */
 
 /*  hblk allocation: */
-void GC_new_hblk(size_t size_in_granules, int kind);
+GC_INNER void GC_new_hblk(size_t size_in_granules, int kind);
                                 /* Allocate a new heap block, and build */
                                 /* a free list in it.                   */
 
-ptr_t GC_build_fl(struct hblk *h, size_t words, GC_bool clear, ptr_t list);
+GC_INNER ptr_t GC_build_fl(struct hblk *h, size_t words, GC_bool clear,
+                           ptr_t list);
                                 /* Build a free list for objects of     */
                                 /* size sz in block h.  Append list to  */
                                 /* end of the free lists.  Possibly     */
@@ -1629,12 +1636,13 @@ ptr_t GC_build_fl(struct hblk *h, size_t words, GC_bool clear, ptr_t list);
                                 /* called by GC_new_hblk, but also      */
                                 /* called explicitly without GC lock.   */
 
-struct hblk * GC_allochblk(size_t size_in_bytes, int kind, unsigned flags);
+GC_INNER struct hblk * GC_allochblk(size_t size_in_bytes, int kind,
+                                    unsigned flags);
                                 /* Allocate a heap block, inform        */
                                 /* the marker that block is valid       */
                                 /* for objects of indicated size.       */
 
-ptr_t GC_alloc_large(size_t lb, int k, unsigned flags);
+GC_INNER ptr_t GC_alloc_large(size_t lb, int k, unsigned flags);
                         /* Allocate a large block of size lb bytes.     */
                         /* The block is not cleared.                    */
                         /* Flags is 0 or IGNORE_OFF_PAGE.               */
@@ -1644,39 +1652,40 @@ ptr_t GC_alloc_large(size_t lb, int k, unsigned flags);
                         /* Does not update GC_bytes_allocd, but does    */
                         /* other accounting.                            */
 
-void GC_freehblk(struct hblk * p);
+GC_INNER void GC_freehblk(struct hblk * p);
                                 /* Deallocate a heap block and mark it  */
                                 /* as invalid.                          */
 
 /*  Misc GC: */
-GC_bool GC_expand_hp_inner(word n);
-void GC_start_reclaim(int abort_if_found);
+GC_INNER GC_bool GC_expand_hp_inner(word n);
+GC_INNER void GC_start_reclaim(int abort_if_found);
                                 /* Restore unmarked objects to free     */
                                 /* lists, or (if abort_if_found is      */
                                 /* TRUE) report them.                   */
                                 /* Sweeping of small object pages is    */
                                 /* largely deferred.                    */
-void GC_continue_reclaim(size_t sz, int kind);
+GC_INNER void GC_continue_reclaim(size_t sz, int kind);
                                 /* Sweep pages of the given size and    */
                                 /* kind, as long as possible, and       */
                                 /* as long as the corr. free list is    */
                                 /* empty.  Sz is in granules.           */
 
-GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old);
+GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old);
                                 /* Reclaim all blocks.  Abort (in a     */
                                 /* consistent state) if f returns TRUE. */
-ptr_t GC_reclaim_generic(struct hblk * hbp, hdr *hhdr, size_t sz,
-                         GC_bool init, ptr_t list, signed_word *count);
+GC_INNER ptr_t GC_reclaim_generic(struct hblk * hbp, hdr *hhdr, size_t sz,
+                                  GC_bool init, ptr_t list,
+                                  signed_word *count);
                                 /* Rebuild free list in hbp with        */
                                 /* header hhdr, with objects of size sz */
                                 /* bytes.  Add list to the end of the   */
                                 /* free list.  Add the number of        */
                                 /* reclaimed bytes to *count.           */
-GC_bool GC_block_empty(hdr * hhdr);
+GC_INNER GC_bool GC_block_empty(hdr * hhdr);
                                 /* Block completely unmarked?   */
-int GC_CALLBACK GC_never_stop_func(void);
+GC_INNER int GC_CALLBACK GC_never_stop_func(void);
                                 /* Always returns 0 (FALSE).            */
-GC_bool GC_try_to_collect_inner(GC_stop_func f);
+GC_INNER GC_bool GC_try_to_collect_inner(GC_stop_func f);
 
                                 /* Collect; caller must have acquired   */
                                 /* lock.  Collection is aborted if f    */
@@ -1693,7 +1702,7 @@ GC_EXTERN GC_bool GC_is_initialized; /* GC_init() has been run. */
                                 /* GC_init                              */
 #endif
 
-void GC_collect_a_little_inner(int n);
+GC_INNER void GC_collect_a_little_inner(int n);
                                 /* Do n units worth of garbage          */
                                 /* collection work, if appropriate.     */
                                 /* A unit is an amount appropriate for  */
@@ -1709,25 +1718,25 @@ void GC_collect_a_little_inner(int n);
                                 /* communicate object layout info       */
                                 /* to the collector.                    */
                                 /* The actual decl is in gc_mark.h.     */
-void * GC_generic_malloc_ignore_off_page(size_t b, int k);
+GC_INNER void * GC_generic_malloc_ignore_off_page(size_t b, int k);
                                 /* As above, but pointers past the      */
                                 /* first page of the resulting object   */
                                 /* are ignored.                         */
-void * GC_generic_malloc_inner(size_t lb, int k);
+GC_INNER void * GC_generic_malloc_inner(size_t lb, int k);
                                 /* Ditto, but I already hold lock, etc. */
-void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k);
+GC_INNER void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k);
                                 /* Allocate an object, where            */
                                 /* the client guarantees that there     */
                                 /* will always be a pointer to the      */
                                 /* beginning of the object while the    */
                                 /* object is live.                      */
 
-ptr_t GC_allocobj(size_t sz, int kind);
+GC_INNER ptr_t GC_allocobj(size_t sz, int kind);
                                 /* Make the indicated                   */
                                 /* free list nonempty, and return its   */
                                 /* head.  Sz is in granules.            */
 
-void * GC_clear_stack(void *);
+GC_INNER void * GC_clear_stack(void *);
                                 /* in misc.c, behaves like identity.    */
 
 /* We make the GC_clear_stack() call a tail one, hoping to get more of  */
@@ -1739,54 +1748,54 @@ void * GC_clear_stack(void *);
 
 /* Allocation routines that bypass the thread local cache.      */
 #ifdef THREAD_LOCAL_ALLOC
-  void * GC_core_malloc(size_t);
-  void * GC_core_malloc_atomic(size_t);
+  GC_INNER void * GC_core_malloc(size_t);
+  GC_INNER void * GC_core_malloc_atomic(size_t);
 # ifdef GC_GCJ_SUPPORT
-    void * GC_core_gcj_malloc(size_t, void *);
+    GC_INNER void * GC_core_gcj_malloc(size_t, void *);
 # endif
 #endif /* THREAD_LOCAL_ALLOC */
 
-void GC_init_headers(void);
-struct hblkhdr * GC_install_header(struct hblk *h);
+GC_INNER void GC_init_headers(void);
+GC_INNER struct hblkhdr * GC_install_header(struct hblk *h);
                                 /* Install a header for block h.        */
                                 /* Return 0 on failure, or the header   */
                                 /* otherwise.                           */
-GC_bool GC_install_counts(struct hblk * h, size_t sz);
+GC_INNER GC_bool GC_install_counts(struct hblk * h, size_t sz);
                                 /* Set up forwarding counts for block   */
                                 /* h of size sz.                        */
                                 /* Return FALSE on failure.             */
-void GC_remove_header(struct hblk * h);
+GC_INNER void GC_remove_header(struct hblk * h);
                                 /* Remove the header for block h.       */
-void GC_remove_counts(struct hblk * h, size_t sz);
+GC_INNER void GC_remove_counts(struct hblk * h, size_t sz);
                                 /* Remove forwarding counts for h.      */
-hdr * GC_find_header(ptr_t h);
+GC_INNER hdr * GC_find_header(ptr_t h);
 
-void GC_finalize(void);
+GC_INNER void GC_finalize(void);
                         /* Perform all indicated finalization actions   */
                         /* on unmarked objects.                         */
                         /* Unreachable finalizable objects are enqueued */
                         /* for processing by GC_invoke_finalizers.      */
                         /* Invoked with lock.                           */
 
-void GC_notify_or_invoke_finalizers(void);
+GC_INNER void GC_notify_or_invoke_finalizers(void);
                         /* If GC_finalize_on_demand is not set, invoke  */
                         /* eligible finalizers. Otherwise:              */
                         /* Call *GC_finalizer_notifier if there are     */
                         /* finalizers to be run, and we haven't called  */
                         /* this procedure yet this GC cycle.            */
 
-void GC_add_to_heap(struct hblk *p, size_t bytes);
+GC_INNER void GC_add_to_heap(struct hblk *p, size_t bytes);
                         /* Add a HBLKSIZE aligned chunk to the heap.    */
 
 #ifdef USE_PROC_FOR_LIBRARIES
-  void GC_add_to_our_memory(ptr_t p, size_t bytes);
+  GC_INNER void GC_add_to_our_memory(ptr_t p, size_t bytes);
                         /* Add a chunk to GC_our_memory.        */
                         /* If p == 0, do nothing.               */
 #else
 # define GC_add_to_our_memory(p, bytes)
 #endif
 
-void GC_print_all_errors(void);
+GC_INNER void GC_print_all_errors(void);
                         /* Print smashed and leaked objects, if any.    */
                         /* Clear the lists of such objects.             */
 
@@ -1832,7 +1841,7 @@ GC_EXTERN GC_bool GC_have_errors; /* We saw a smashed or leaked object. */
 
 #ifdef KEEP_BACK_PTRS
   GC_EXTERN long GC_backtraces;
-  void GC_generate_random_backtrace_no_gc(void);
+  GC_INNER void GC_generate_random_backtrace_no_gc(void);
 #endif
 
 GC_EXTERN GC_bool GC_print_back_height;
@@ -1842,19 +1851,20 @@ GC_EXTERN GC_bool GC_print_back_height;
 #endif
 
 #ifdef THREADS
-  void GC_free_inner(void * p);
+  GC_INNER void GC_free_inner(void * p);
 #endif
 
 /* Macros used for collector internal allocation.       */
 /* These assume the collector lock is held.             */
 #ifdef DBG_HDRS_ALL
-    void * GC_debug_generic_malloc_inner(size_t lb, int k);
-    void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb, int k);
+    GC_INNER void * GC_debug_generic_malloc_inner(size_t lb, int k);
+    GC_INNER void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb,
+                                                                  int k);
 #   define GC_INTERNAL_MALLOC GC_debug_generic_malloc_inner
 #   define GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE \
                  GC_debug_generic_malloc_inner_ignore_off_page
 #   ifdef THREADS
-        void GC_debug_free_inner(void * p);
+        GC_INNER void GC_debug_free_inner(void * p);
 #       define GC_INTERNAL_FREE GC_debug_free_inner
 #   else
 #       define GC_INTERNAL_FREE GC_debug_free
@@ -1872,31 +1882,32 @@ GC_EXTERN GC_bool GC_print_back_height;
 
 #ifdef USE_MUNMAP
   /* Memory unmapping: */
-  void GC_unmap_old(void);
-  void GC_merge_unmapped(void);
-  void GC_unmap(ptr_t start, size_t bytes);
-  void GC_remap(ptr_t start, size_t bytes);
-  void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2, size_t bytes2);
+  GC_INNER void GC_unmap_old(void);
+  GC_INNER void GC_merge_unmapped(void);
+  GC_INNER void GC_unmap(ptr_t start, size_t bytes);
+  GC_INNER void GC_remap(ptr_t start, size_t bytes);
+  GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2,
+                             size_t bytes2);
 #endif
 
 /* Virtual dirty bit implementation:            */
 /* Each implementation exports the following:   */
-void GC_read_dirty(void);
+GC_INNER void GC_read_dirty(void);
                         /* Retrieve dirty bits. */
-GC_bool GC_page_was_dirty(struct hblk *h);
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h);
                         /* Read retrieved dirty bits.   */
-void GC_remove_protection(struct hblk *h, word nblocks,
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
                                    GC_bool pointerfree);
                         /* h is about to be written or allocated.  Ensure   */
                         /* that it's not write protected by the virtual     */
                         /* dirty bit implementation.                        */
 
-void GC_dirty_init(void);
+GC_INNER void GC_dirty_init(void);
 
 /* Slow/general mark bit manipulation: */
 GC_API_PRIV GC_bool GC_is_marked(ptr_t p);
-void GC_clear_mark_bit(ptr_t p);
-void GC_set_mark_bit(ptr_t p);
+GC_INNER void GC_clear_mark_bit(ptr_t p);
+GC_INNER void GC_set_mark_bit(ptr_t p);
 
 /* Stubborn objects: */
 void GC_read_changed(void); /* Analogous to GC_read_dirty */
@@ -1911,12 +1922,12 @@ void GC_print_block_list(void);
 void GC_print_hblkfreelist(void);
 void GC_print_heap_sects(void);
 void GC_print_static_roots(void);
-void GC_print_finalization_stats(void);
+GC_INNER void GC_print_finalization_stats(void);
 /* void GC_dump(void); - declared in gc.h */
 
 #ifdef KEEP_BACK_PTRS
-   void GC_store_back_pointer(ptr_t source, ptr_t dest);
-   void GC_marked_for_finalization(ptr_t dest);
+   GC_INNER void GC_store_back_pointer(ptr_t source, ptr_t dest);
+   GC_INNER void GC_marked_for_finalization(ptr_t dest);
 #  define GC_STORE_BACK_PTR(source, dest) GC_store_back_pointer(source, dest)
 #  define GC_MARKED_FOR_FINALIZATION(dest) GC_marked_for_finalization(dest)
 #else
@@ -1962,7 +1973,7 @@ void GC_err_puts(const char *s);
                         /* newlines, don't ...                          */
 
 #if defined(LINUX) && !defined(SMALL_CONFIG)
-  void GC_err_write(const char *buf, size_t len);
+  GC_INNER void GC_err_write(const char *buf, size_t len);
                         /* Write buf to stderr, don't buffer, don't add */
                         /* newlines, don't ...                          */
 #endif
@@ -2055,18 +2066,18 @@ GC_EXTERN signed_word GC_bytes_found;
     /* GC_notify_all_builder() is called when GC_fl_builder_count       */
     /* reaches 0.                                                       */
 
-    void GC_acquire_mark_lock(void);
-    void GC_release_mark_lock(void);
-    void GC_notify_all_builder(void);
-    void GC_wait_for_reclaim(void);
+    GC_INNER void GC_acquire_mark_lock(void);
+    GC_INNER void GC_release_mark_lock(void);
+    GC_INNER void GC_notify_all_builder(void);
+    GC_INNER void GC_wait_for_reclaim(void);
 
     GC_EXTERN word GC_fl_builder_count;   /* Protected by mark lock.    */
 
-    void GC_notify_all_marker(void);
-    void GC_wait_marker(void);
+    GC_INNER void GC_notify_all_marker(void);
+    GC_INNER void GC_wait_marker(void);
     GC_EXTERN word GC_mark_no;            /* Protected by mark lock.    */
 
-    void GC_help_marker(word my_mark_no);
+    GC_INNER void GC_help_marker(word my_mark_no);
                 /* Try to help out parallel marker for mark cycle       */
                 /* my_mark_no.  Returns if the mark cycle finishes or   */
                 /* was already done, or there was nothing to do for     */
@@ -2165,10 +2176,10 @@ JMP_BUF GC_jmp_buf;
 
 /* Set up a handler for address faults which will longjmp to    */
 /* GC_jmp_buf;                                                  */
-void GC_setup_temporary_fault_handler(void);
+GC_INNER void GC_setup_temporary_fault_handler(void);
 
 /* Undo the effect of GC_setup_temporary_fault_handler.         */
-void GC_reset_fault_handler(void);
+GC_INNER void GC_reset_fault_handler(void);
 
 # endif /* Need to handle address faults.       */
 
index 7ffcb08..df7a482 100644 (file)
@@ -102,9 +102,9 @@ GC_EXTERN volatile GC_thread GC_threads[THREAD_TABLE_SZ];
 
 GC_EXTERN GC_bool GC_thr_initialized;
 
-GC_thread GC_lookup_thread(pthread_t id);
+GC_INNER GC_thread GC_lookup_thread(pthread_t id);
 
-void GC_stop_init(void);
+GC_INNER void GC_stop_init(void);
 
 GC_EXTERN GC_bool GC_in_thread_creation;
         /* We may currently be in thread creation or destruction.       */
index e07880f..0886adc 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "gc_inline.h"
 
-
 # if defined(USE_HPUX_TLS)
 #   error USE_HPUX_TLS macro was replaced by USE_COMPILER_TLS
 # endif
@@ -130,17 +129,17 @@ typedef struct thread_local_freelists {
 /* Each thread structure must be initialized.   */
 /* This call must be made from the new thread.  */
 /* Caller holds allocation lock.                */
-void GC_init_thread_local(GC_tlfs p);
+GC_INNER void GC_init_thread_local(GC_tlfs p);
 
 /* Called when a thread is unregistered, or exits.      */
 /* We hold the allocator lock.                          */
-void GC_destroy_thread_local(GC_tlfs p);
+GC_INNER void GC_destroy_thread_local(GC_tlfs p);
 
 /* The thread support layer must arrange to mark thread-local   */
 /* free lists explicitly, since the link field is often         */
 /* invisible to the marker.  It knows how to find all threads;  */
 /* we take care of an individual thread freelist structure.     */
-void GC_mark_thread_local_fls_for(GC_tlfs p);
+GC_INNER void GC_mark_thread_local_fls_for(GC_tlfs p);
 
 extern
 #if defined(USE_COMPILER_TLS)
index 782fdc5..24d3332 100644 (file)
@@ -188,7 +188,8 @@ asm static void PushMacRegisters()
 /* Ensure that either registers are pushed, or callee-save registers    */
 /* are somewhere on the stack, and then call fn(arg, ctxt).             */
 /* ctxt is either a pointer to a ucontext_t we generated, or NULL.      */
-void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *), ptr_t arg)
+GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
+                                          ptr_t arg)
 {
     word dummy;
     void * context = 0;
index 041a3e1..f6a3f3f 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -21,7 +21,7 @@
 # include <errno.h>
 #endif
 
-void GC_extend_size_map(size_t); /* in misc.c. */
+GC_INNER void GC_extend_size_map(size_t); /* in misc.c */
 
 /* Allocate reclaim list for kind:      */
 /* Return TRUE on success               */
@@ -35,15 +35,16 @@ STATIC GC_bool GC_alloc_reclaim_list(struct obj_kind *kind)
     return(TRUE);
 }
 
-GC_bool GC_collect_or_expand(word needed_blocks, GC_bool ignore_off_page,
-                             GC_bool retry); /* from alloc.c */
+GC_INNER GC_bool GC_collect_or_expand(word needed_blocks,
+                                      GC_bool ignore_off_page,
+                                      GC_bool retry); /* from alloc.c */
 
 /* Allocate a large block of size lb bytes.     */
 /* The block is not cleared.                    */
 /* Flags is 0 or IGNORE_OFF_PAGE.               */
 /* We hold the allocation lock.                 */
 /* EXTRA_BYTES were already added to lb.        */
-ptr_t GC_alloc_large(size_t lb, int k, unsigned flags)
+GC_INNER ptr_t GC_alloc_large(size_t lb, int k, unsigned flags)
 {
     struct hblk * h;
     word n_blocks;
@@ -104,7 +105,7 @@ STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags)
 /* require special handling on allocation.      */
 /* First a version that assumes we already      */
 /* hold lock:                                   */
-void * GC_generic_malloc_inner(size_t lb, int k)
+GC_INNER void * GC_generic_malloc_inner(size_t lb, int k)
 {
     void *op;
 
@@ -140,7 +141,7 @@ out:
 /* Allocate a composite object of size n bytes.  The caller guarantees  */
 /* that pointers past the first page are not relevant.  Caller holds    */
 /* allocation lock.                                                     */
-void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k)
+GC_INNER void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k)
 {
     word lb_adjusted;
     void * op;
@@ -204,7 +205,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
 
 /* Allocate lb bytes of atomic (pointerfree) data */
 #ifdef THREAD_LOCAL_ALLOC
-  void * GC_core_malloc_atomic(size_t lb)
+  GC_INNER void * GC_core_malloc_atomic(size_t lb)
 #else
   GC_API void * GC_CALL GC_malloc_atomic(size_t lb)
 #endif
@@ -256,7 +257,7 @@ GC_API char * GC_CALL GC_strdup(const char *s)
 
 /* Allocate lb bytes of composite (pointerful) data */
 #ifdef THREAD_LOCAL_ALLOC
-  void * GC_core_malloc(size_t lb)
+  GC_INNER void * GC_core_malloc(size_t lb)
 #else
   GC_API void * GC_CALL GC_malloc(size_t lb)
 #endif
@@ -326,7 +327,7 @@ void * malloc(size_t lb)
   STATIC ptr_t GC_libpthread_end = 0;
   STATIC ptr_t GC_libld_start = 0;
   STATIC ptr_t GC_libld_end = 0;
-  GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp);
+  GC_INNER GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp);
                                                 /* From os_dep.c */
 
   STATIC void GC_init_lib_bounds(void)
@@ -456,7 +457,7 @@ GC_API void GC_CALL GC_free(void * p)
 /* Only used for internally allocated objects, so we can take some      */
 /* shortcuts.                                                           */
 #ifdef THREADS
-  void GC_free_inner(void * p)
+  GC_INNER void GC_free_inner(void * p)
   {
     struct hblk *h;
     hdr *hhdr;
index 9f44a1d..99a0336 100644 (file)
--- a/mallocx.c
+++ b/mallocx.c
@@ -162,7 +162,7 @@ void * realloc(void * p, size_t lb)
 /* Allocate memory such that only pointers to near the          */
 /* beginning of the object are considered.                      */
 /* We avoid holding allocation lock while we clear memory.      */
-void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
+GC_INNER void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
 {
     void *result;
     size_t lg;
diff --git a/mark.c b/mark.c
index ae05761..4546aef 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -135,13 +135,13 @@ STATIC GC_bool GC_objects_are_marked = FALSE;
 /* Is a collection in progress?  Note that this can return true in the  */
 /* nonincremental case, if a collection has been abandoned and the      */
 /* mark state is now MS_INVALID.                                        */
-GC_bool GC_collection_in_progress(void)
+GC_INNER GC_bool GC_collection_in_progress(void)
 {
     return(GC_mark_state != MS_NONE);
 }
 
 /* clear all mark bits in the header */
-void GC_clear_hdr_marks(hdr *hhdr)
+GC_INNER void GC_clear_hdr_marks(hdr *hhdr)
 {
     size_t last_bit = FINAL_MARK_BIT(hhdr -> hb_sz);
 
@@ -156,7 +156,7 @@ void GC_clear_hdr_marks(hdr *hhdr)
 }
 
 /* Set all mark bits in the header.  Used for uncollectable blocks. */
-void GC_set_hdr_marks(hdr *hhdr)
+GC_INNER void GC_set_hdr_marks(hdr *hhdr)
 {
     unsigned i;
     size_t sz = hhdr -> hb_sz;
@@ -194,7 +194,7 @@ static void clear_marks_for_block(struct hblk *h, word dummy)
 }
 
 /* Slow but general routines for setting/clearing/asking about mark bits */
-void GC_set_mark_bit(ptr_t p)
+GC_INNER void GC_set_mark_bit(ptr_t p)
 {
     struct hblk *h = HBLKPTR(p);
     hdr * hhdr = HDR(h);
@@ -206,7 +206,7 @@ void GC_set_mark_bit(ptr_t p)
     }
 }
 
-void GC_clear_mark_bit(ptr_t p)
+GC_INNER void GC_clear_mark_bit(ptr_t p)
 {
     struct hblk *h = HBLKPTR(p);
     hdr * hhdr = HDR(h);
@@ -243,7 +243,7 @@ GC_bool GC_is_marked(ptr_t p)
  * the marker invariant, and sets GC_mark_state to reflect this.
  * (This implicitly starts marking to reestablish the invariant.)
  */
-void GC_clear_marks(void)
+GC_INNER void GC_clear_marks(void)
 {
     GC_apply_to_all_blocks(clear_marks_for_block, (word)0);
     GC_objects_are_marked = FALSE;
@@ -257,7 +257,7 @@ void GC_clear_marks(void)
 
 /* Initiate a garbage collection.  Initiates a full collection if the   */
 /* mark state is invalid.                                               */
-void GC_initiate_gc(void)
+GC_INNER void GC_initiate_gc(void)
 {
     if (GC_dirty_maintained) GC_read_dirty();
 #   ifdef STUBBORN_ALLOC
@@ -323,7 +323,7 @@ static void alloc_mark_stack(size_t);
   /* allocator lock long before we get here.                    */
   STATIC GC_bool GC_mark_some_inner(ptr_t cold_gc_frame)
 #else
-  GC_bool GC_mark_some(ptr_t cold_gc_frame)
+  GC_INNER GC_bool GC_mark_some(ptr_t cold_gc_frame)
 #endif
 {
     switch(GC_mark_state) {
@@ -490,7 +490,7 @@ static void alloc_mark_stack(size_t);
   /* unexpected thread start?                                   */
 #endif
 
-  GC_bool GC_mark_some(ptr_t cold_gc_frame)
+  GC_INNER GC_bool GC_mark_some(ptr_t cold_gc_frame)
   {
       GC_bool ret_val;
 
@@ -588,18 +588,18 @@ handle_ex:
   }
 #endif /* WRAP_MARK_SOME */
 
-GC_bool GC_mark_stack_empty(void)
+GC_INNER GC_bool GC_mark_stack_empty(void)
 {
     return(GC_mark_stack_top < GC_mark_stack);
 }
 
-void GC_invalidate_mark_state(void)
+GC_INNER void GC_invalidate_mark_state(void)
 {
     GC_mark_state = MS_INVALID;
     GC_mark_stack_top = GC_mark_stack-1;
 }
 
-mse * GC_signal_mark_stack_overflow(mse *msp)
+GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp)
 {
     GC_mark_state = MS_INVALID;
     GC_mark_stack_too_small = TRUE;
@@ -624,7 +624,8 @@ mse * GC_signal_mark_stack_overflow(mse *msp)
  * encoding, we optionally maintain a cache for the block address to
  * header mapping, we prefetch when an object is "grayed", etc.
  */
-mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
+GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
+                            mse *mark_stack_limit)
 {
   signed_word credit = HBLKSIZE;  /* Remaining credit for marking work  */
   ptr_t current_p;      /* Pointer to current candidate ptr.    */
@@ -1173,7 +1174,7 @@ STATIC void GC_do_parallel_mark(void)
 
 /* Try to help out the marker, if it's running.         */
 /* We do not hold the GC lock, but the requestor does.  */
-void GC_help_marker(word my_mark_no)
+GC_INNER void GC_help_marker(word my_mark_no)
 {
     mse local_mark_stack[LOCAL_MARK_STACK_SIZE];
     unsigned my_id;
@@ -1256,7 +1257,7 @@ static void alloc_mark_stack(size_t n)
     GC_mark_stack_top = GC_mark_stack-1;
 }
 
-void GC_mark_init(void)
+GC_INNER void GC_mark_init(void)
 {
     alloc_mark_stack(INITIAL_MARK_STACK_SIZE);
 }
@@ -1268,7 +1269,7 @@ void GC_mark_init(void)
  * Should only be used if there is no possibility of mark stack
  * overflow.
  */
-void GC_push_all(ptr_t bottom, ptr_t top)
+GC_INNER void GC_push_all(ptr_t bottom, ptr_t top)
 {
     register word length;
 
@@ -1344,11 +1345,11 @@ void GC_push_all(ptr_t bottom, ptr_t top)
   }
 
 # ifdef PROC_VDB
-    GC_bool GC_page_was_ever_dirty(struct hblk *h);
+    GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h);
                         /* Could the page contain valid heap pointers?  */
 # endif
 
-  void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all)
+  GC_INNER void GC_push_conditional(ptr_t bottom, ptr_t top, GC_bool all)
   {
     if (all) {
       if (GC_dirty_maintained) {
@@ -1418,9 +1419,9 @@ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
 /* Mark bits are NOT atomically updated.  Thus this must be the */
 /* only thread setting them.                                    */
 # if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
-    void GC_mark_and_push_stack(ptr_t p, ptr_t source)
+    GC_INNER void GC_mark_and_push_stack(ptr_t p, ptr_t source)
 # else
-    void GC_mark_and_push_stack(ptr_t p)
+    GC_INNER void GC_mark_and_push_stack(ptr_t p)
 #   define source ((ptr_t)0)
 # endif
 {
@@ -1509,7 +1510,7 @@ void GC_print_trace(word gc_no, GC_bool lock)
  * and scans the entire region immediately, in case the contents
  * change.
  */
-void GC_push_all_eager(ptr_t bottom, ptr_t top)
+GC_INNER void GC_push_all_eager(ptr_t bottom, ptr_t top)
 {
     word * b = (word *)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
     word * t = (word *)(((word) top) & ~(ALIGNMENT-1));
@@ -1533,7 +1534,7 @@ void GC_push_all_eager(ptr_t bottom, ptr_t top)
 #   undef GC_least_plausible_heap_addr
 }
 
-void GC_push_all_stack(ptr_t bottom, ptr_t top)
+GC_INNER void GC_push_all_stack(ptr_t bottom, ptr_t top)
 {
 # if defined(THREADS) && defined(MPROTECT_VDB)
     GC_push_all_eager(bottom, top);
index 41b942f..f53393e 100644 (file)
@@ -64,7 +64,7 @@ static int n_root_sets = 0;
 #ifndef THREADS
   /* Primarily for debugging support:     */
   /* Is the address p in one of the registered static root sections?      */
-  GC_bool GC_is_static_root(ptr_t p)
+  GC_INNER GC_bool GC_is_static_root(ptr_t p)
   {
     static int last_root_set = MAX_ROOT_SETS;
     int i;
@@ -111,7 +111,7 @@ static int n_root_sets = 0;
 
   /* Is a range starting at b already in the table? If so return a        */
   /* pointer to it, else NIL.                                             */
-  struct roots * GC_roots_present(ptr_t b)
+  GC_INNER struct roots * GC_roots_present(ptr_t b)
   {
     int h = rt_hash(b);
     struct roots *p = GC_root_index[h];
@@ -357,7 +357,7 @@ STATIC void GC_remove_tmp_roots(void)
   }
 #endif /* MSWIN32 || MSWINCE */
 
-ptr_t GC_approx_sp(void)
+GC_INNER ptr_t GC_approx_sp(void)
 {
     volatile word sp;
     sp = (word)&sp;
@@ -407,7 +407,7 @@ STATIC struct exclusion * GC_next_exclusion(ptr_t start_addr)
 
 /* Should only be called when the lock is held.  The range boundaries   */
 /* should be properly aligned and valid.                                */
-void GC_exclude_static_roots_inner(void *start, void *finish)
+GC_INNER void GC_exclude_static_roots_inner(void *start, void *finish)
 {
     struct exclusion * next;
     size_t next_index, i;
@@ -478,7 +478,7 @@ STATIC void GC_push_conditional_with_exclusions(ptr_t bottom, ptr_t top,
 
 #ifdef IA64
   /* Similar to GC_push_all_stack_frames() but for IA-64 registers store. */
-  void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi,
+  GC_INNER void GC_push_all_register_frames(ptr_t bs_lo, ptr_t bs_hi,
                     int eager, struct GC_activation_frame_s *activation_frame)
   {
     while (activation_frame != NULL) {
@@ -503,7 +503,7 @@ STATIC void GC_push_conditional_with_exclusions(ptr_t bottom, ptr_t top,
 
 #ifdef THREADS
 
-void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
+GC_INNER void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
                         struct GC_activation_frame_s *activation_frame)
 {
     while (activation_frame != NULL) {
@@ -692,10 +692,10 @@ STATIC void GC_push_gc_structures(void)
 }
 
 #ifdef THREAD_LOCAL_ALLOC
-  void GC_mark_thread_local_free_lists(void);
+  GC_INNER void GC_mark_thread_local_free_lists(void);
 #endif
 
-void GC_cond_register_dynamic_libraries(void)
+GC_INNER void GC_cond_register_dynamic_libraries(void)
 {
 # if defined(DYNAMIC_LOADING) || defined(MSWIN32) || defined(MSWINCE) \
      || defined(PCR)
@@ -720,7 +720,7 @@ STATIC void GC_push_regs_and_stack(ptr_t cold_gc_frame)
  * A zero value indicates that it's OK to miss some
  * register values.
  */
-void GC_push_roots(GC_bool all, ptr_t cold_gc_frame)
+GC_INNER void GC_push_roots(GC_bool all, ptr_t cold_gc_frame)
 {
     int i;
     unsigned kind;
diff --git a/misc.c b/misc.c
index 34d0b90..1af1b6b 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -52,7 +52,7 @@
 #ifdef DYNAMIC_LOADING
   /* We need to register the main data segment.  Returns  TRUE unless   */
   /* this is done implicitly as part of dynamic library registration.   */
-  GC_bool GC_register_main_static_data(void);
+  GC_INNER GC_bool GC_register_main_static_data(void);
 # define GC_REGISTER_MAIN_STATIC_DATA() GC_register_main_static_data()
 #else
   /* Don't unnecessarily call GC_register_main_static_data() in case    */
@@ -161,7 +161,7 @@ STATIC void GC_init_size_map(void)
 /* We assume the ith entry is currently 0.                              */
 /* Note that a filled in section of the array ending at n always    */
 /* has length at least n/4.                                             */
-void GC_extend_size_map(size_t i)
+GC_INNER void GC_extend_size_map(size_t i)
 {
     size_t orig_granule_sz = ROUNDED_UP_GRANULES(i);
     size_t granule_sz = orig_granule_sz;
@@ -257,7 +257,7 @@ 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.                                                       */
-void * GC_clear_stack(void *arg)
+GC_INNER void * GC_clear_stack(void *arg)
 {
     ptr_t sp = GC_approx_sp();  /* Hotter than actual sp */
 #   ifdef THREADS
@@ -458,10 +458,10 @@ GC_INNER GC_bool GC_is_initialized = FALSE;
 #endif
 
 #ifdef MSWIN32
-    void GC_init_win32(void);
+    GC_INNER void GC_init_win32(void);
 #endif
 
-void GC_setpagesize(void);
+GC_INNER void GC_setpagesize(void);
 
 STATIC void GC_exit_check(void)
 {
@@ -469,12 +469,12 @@ STATIC void GC_exit_check(void)
 }
 
 #ifdef SEARCH_FOR_DATA_START
-  void GC_init_linux_data_start(void);
+  GC_INNER void GC_init_linux_data_start(void);
 #endif
 
 #ifdef UNIX_LIKE
 
-  void GC_set_and_save_fault_handler(void (*handler)(int));
+  GC_INNER void GC_set_and_save_fault_handler(void (*handler)(int));
 
   static void looping_handler(int sig)
   {
@@ -499,11 +499,11 @@ STATIC void GC_exit_check(void)
 #endif
 
 #if defined(DYNAMIC_LOADING) && defined(DARWIN)
-  void GC_init_dyld(void);
+  GC_INNER void GC_init_dyld(void);
 #endif
 
 #if defined(NETBSD) && defined(__ELF__)
-  void GC_init_netbsd_elf(void);
+  GC_INNER void GC_init_netbsd_elf(void);
 #endif
 
 #if !defined(OS2) && !defined(MACOS) && !defined(MSWIN32) && !defined(MSWINCE)
@@ -1162,7 +1162,7 @@ void GC_err_puts(const char *s)
 }
 
 #if defined(LINUX) && !defined(SMALL_CONFIG)
-  void GC_err_write(const char *buf, size_t len)
+  GC_INNER void GC_err_write(const char *buf, size_t len)
   {
     if (WRITE(GC_stderr, buf, len) < 0) ABORT("write to stderr failed");
   }
@@ -1348,7 +1348,7 @@ GC_API void * GC_CALL GC_call_with_stack_base(GC_stack_base_func fn, void *arg)
 #ifdef THREADS
 
   /* Defined in pthread_support.c or win32_threads.c.     */
-  void GC_do_blocking_inner(ptr_t data, void * context);
+  GC_INNER void GC_do_blocking_inner(ptr_t data, void * context);
 
 #else
 
index 3ff8f59..62e96f6 100644 (file)
@@ -110,7 +110,8 @@ STATIC ptr_t GC_build_fl4(struct hblk *h, ptr_t ofl)
 /* This could be called without the main GC lock, if we ensure that     */
 /* there is no concurrent collection which might reclaim objects that   */
 /* we have not yet allocated.                                           */
-ptr_t GC_build_fl(struct hblk *h, size_t sz, GC_bool clear, ptr_t list)
+GC_INNER ptr_t GC_build_fl(struct hblk *h, size_t sz, GC_bool clear,
+                           ptr_t list)
 {
   word *p, *prev;
   word *last_object;            /* points to last object in new hblk    */
@@ -126,7 +127,7 @@ ptr_t GC_build_fl(struct hblk *h, size_t sz, GC_bool clear, ptr_t list)
   /* Handle small objects sizes more efficiently.  For larger objects   */
   /* the difference is less significant.                                */
 #  ifndef SMALL_CONFIG
-    switch (sz) {
+     switch (sz) {
         case 2: if (clear) {
                     return GC_build_fl_clear2(h, list);
                 } else {
@@ -139,7 +140,7 @@ ptr_t GC_build_fl(struct hblk *h, size_t sz, GC_bool clear, ptr_t list)
                 }
         default:
                 break;
-    }
+     }
 #  endif /* !SMALL_CONFIG */
 
   /* Clear the page if necessary. */
@@ -177,7 +178,7 @@ ptr_t GC_build_fl(struct hblk *h, size_t sz, GC_bool clear, ptr_t list)
  * Set all mark bits if objects are uncollectable.
  * Will fail to do anything if we are out of memory.
  */
-void GC_new_hblk(size_t gran, int kind)
+GC_INNER void GC_new_hblk(size_t gran, int kind)
 {
   struct hblk *h;       /* the new heap block                   */
   GC_bool clear = GC_obj_kinds[kind].ok_init;
index 542cc71..972ba49 100644 (file)
--- a/obj_map.c
+++ b/obj_map.c
@@ -33,7 +33,7 @@ GC_API void GC_CALL GC_register_displacement(size_t offset)
     UNLOCK();
 }
 
-void GC_register_displacement_inner(size_t offset)
+GC_INNER void GC_register_displacement_inner(size_t offset)
 {
     if (offset >= VALID_OFFSET_SZ) {
         ABORT("Bad argument to GC_register_displacement");
@@ -48,7 +48,7 @@ void GC_register_displacement_inner(size_t offset)
   /* Add a heap block map for objects of size granules to obj_map.      */
   /* Return FALSE on failure.                                           */
   /* A size of 0 granules is used for large objects.                    */
-  GC_bool GC_add_map_entry(size_t granules)
+  GC_INNER GC_bool GC_add_map_entry(size_t granules)
   {
     unsigned displ;
     short * new_map;
@@ -76,7 +76,7 @@ void GC_register_displacement_inner(size_t offset)
   }
 #endif
 
-void GC_initialize_offsets(void)
+GC_INNER void GC_initialize_offsets(void)
 {
     static GC_bool offsets_initialized = FALSE;
 
index 81eb0e7..67067d4 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -197,7 +197,7 @@ STATIC ssize_t GC_repeat_read(int fd, char *buf, size_t count)
  * This code could be simplified if we could determine its size
  * ahead of time.
  */
-char * GC_get_maps(void)
+GC_INNER char * GC_get_maps(void)
 {
     int f;
     int result;
@@ -299,7 +299,7 @@ char * GC_get_maps(void)
  * *prot and *mapping_name are assigned pointers into the original
  * buffer.
  */
-char *GC_parse_map_entry(char *buf_ptr, ptr_t *start, ptr_t *end,
+GC_INNER char *GC_parse_map_entry(char *buf_ptr, ptr_t *start, ptr_t *end,
                                   char **prot, unsigned int *maj_dev,
                                   char **mapping_name)
 {
@@ -379,7 +379,7 @@ GC_bool GC_enclosing_mapping(ptr_t addr, ptr_t *startp, ptr_t *endp)
 #if defined(REDIRECT_MALLOC)
 /* Find the text(code) mapping for the library whose name, after        */
 /* stripping the directory part, starts with nm.                        */
-GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp)
+GC_INNER GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp)
 {
   size_t nm_len = strlen(nm);
   char *prot;
@@ -451,7 +451,7 @@ GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp)
 
   ptr_t GC_find_limit(ptr_t, GC_bool);
 
-  void GC_init_linux_data_start(void)
+  GC_INNER void GC_init_linux_data_start(void)
   {
 
 #   if defined(LINUX) || defined(HURD)
@@ -505,7 +505,7 @@ static void *tiny_sbrk(ptrdiff_t increment)
 
   extern char **environ;
 
-  void GC_init_netbsd_elf(void)
+  GC_INNER void GC_init_netbsd_elf(void)
   {
         /* This may need to be environ, without the underscore, for     */
         /* some versions.                                               */
@@ -702,7 +702,7 @@ GC_INNER word GC_page_size = 0;
       GC_INNER GC_bool GC_dont_query_stack_min = FALSE;
 #   endif
 
-    void GC_setpagesize(void)
+    GC_INNER void GC_setpagesize(void)
     {
       GetSystemInfo(&GC_sysinfo);
       GC_page_size = GC_sysinfo.dwPageSize;
@@ -731,7 +731,7 @@ GC_INNER word GC_page_size = 0;
     }
 
 # else
-    void GC_setpagesize(void)
+    GC_INNER void GC_setpagesize(void)
     {
 #     if defined(MPROTECT_VDB) || defined(PROC_VDB) || defined(USE_MMAP)
         GC_page_size = GETPAGESIZE();
@@ -858,7 +858,7 @@ ptr_t GC_get_main_stack_base(void)
         static GC_fault_handler_t old_segv_handler, old_bus_handler;
 #   endif
 
-    void GC_set_and_save_fault_handler(GC_fault_handler_t h)
+    GC_INNER void GC_set_and_save_fault_handler(GC_fault_handler_t h)
     {
 #       if defined(SUNOS5SIGS) || defined(IRIX5)  \
         || defined(OSF1) || defined(HURD) || defined(NETBSD)
@@ -909,7 +909,7 @@ ptr_t GC_get_main_stack_base(void)
         LONGJMP(GC_jmp_buf, 1);
     }
 
-    void GC_setup_temporary_fault_handler(void)
+    GC_INNER void GC_setup_temporary_fault_handler(void)
     {
         /* Handler is process-wide, so this should only happen in */
         /* one thread at a time.                                  */
@@ -917,7 +917,7 @@ ptr_t GC_get_main_stack_base(void)
         GC_set_and_save_fault_handler(GC_fault_handler);
     }
 
-    void GC_reset_fault_handler(void)
+    GC_INNER void GC_reset_fault_handler(void)
     {
 #       if defined(SUNOS5SIGS) || defined(IRIX5) \
            || defined(OSF1) || defined(HURD) || defined(NETBSD)
@@ -988,7 +988,7 @@ ptr_t GC_get_main_stack_base(void)
 #include <sys/param.h>
 #include <sys/pstat.h>
 
-  ptr_t GC_get_register_stack_base(void)
+  GC_INNER ptr_t GC_get_register_stack_base(void)
   {
     struct pst_vm_status vm_status;
 
@@ -1025,7 +1025,7 @@ ptr_t GC_get_main_stack_base(void)
       extern ptr_t __libc_ia64_register_backing_store_base;
 #   endif
 
-    ptr_t GC_get_register_stack_base(void)
+    GC_INNER ptr_t GC_get_register_stack_base(void)
     {
       ptr_t result;
 
@@ -1205,7 +1205,7 @@ ptr_t GC_get_main_stack_base(void)
 /* extern int pthread_getattr_np(pthread_t, pthread_attr_t *); */
 
 #ifdef IA64
-  ptr_t GC_greatest_stack_base_below(ptr_t bound);
+  GC_INNER ptr_t GC_greatest_stack_base_below(ptr_t bound);
                                 /* From pthread_support.c */
 #endif
 
@@ -1535,7 +1535,7 @@ void GC_register_data_segments(void)
   GC_INNER GC_bool GC_wnt = FALSE;
          /* This is a Windows NT derivative, i.e. NT, W2K, XP or later. */
 
-  void GC_init_win32(void)
+  GC_INNER void GC_init_win32(void)
   {
     /* Set GC_wnt.  If we're running under win32s, assume that no DLLs  */
     /* will be loaded.  I doubt anyone still runs win32s, but...        */
@@ -1616,7 +1616,7 @@ void GC_register_data_segments(void)
 
   STATIC size_t GC_max_root_size = 100000;      /* Appr. largest root size.     */
 
-  void GC_add_current_malloc_heap(void)
+  GC_INNER void GC_add_current_malloc_heap(void)
   {
     struct GC_malloc_heap_list *new_l =
                  malloc(sizeof(struct GC_malloc_heap_list));
@@ -1651,7 +1651,7 @@ void GC_register_data_segments(void)
 
   /* Is p the start of either the malloc heap, or of one of our */
   /* heap sections?                                             */
-  GC_bool GC_is_heap_base(ptr_t p)
+  GC_INNER GC_bool GC_is_heap_base(ptr_t p)
   {
      unsigned i;
 #    ifndef REDIRECT_MALLOC
@@ -2221,7 +2221,7 @@ STATIC ptr_t GC_unmap_end(ptr_t start, size_t bytes)
 /* We assume that GC_remap is called on exactly the same range  */
 /* as a previous call to GC_unmap.  It is safe to consistently  */
 /* round the endpoints in both places.                          */
-void GC_unmap(ptr_t start, size_t bytes)
+GC_INNER void GC_unmap(ptr_t start, size_t bytes)
 {
     ptr_t start_addr = GC_unmap_start(start, bytes);
     ptr_t end_addr = GC_unmap_end(start, bytes);
@@ -2255,7 +2255,7 @@ void GC_unmap(ptr_t start, size_t bytes)
 #   endif
 }
 
-void GC_remap(ptr_t start, size_t bytes)
+GC_INNER void GC_remap(ptr_t start, size_t bytes)
 {
     ptr_t start_addr = GC_unmap_start(start, bytes);
     ptr_t end_addr = GC_unmap_end(start, bytes);
@@ -2309,7 +2309,8 @@ void GC_remap(ptr_t start, size_t bytes)
 /* be merged.  Unmap the whole block.  This typically requires          */
 /* that we unmap a small section in the middle that was not previously  */
 /* unmapped due to alignment constraints.                               */
-void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2, size_t bytes2)
+GC_INNER void GC_unmap_gap(ptr_t start1, size_t bytes1, ptr_t start2,
+                           size_t bytes2)
 {
     ptr_t start1_addr = GC_unmap_start(start1, bytes1);
     ptr_t end1_addr = GC_unmap_end(start1, bytes1);
@@ -2403,7 +2404,7 @@ STATIC void GC_default_push_other_roots(void)
 
 # if defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
 
-void GC_push_all_stacks(void);
+GC_INNER void GC_push_all_stacks(void);
 
 STATIC void GC_default_push_other_roots(void)
 {
@@ -2477,13 +2478,13 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
   static PVOID gww_buf[GC_GWW_BUF_LEN];
 
 # ifdef MPROTECT_VDB
-    GC_bool GC_gww_dirty_init(void)
+    GC_INNER GC_bool GC_gww_dirty_init(void)
     {
       detect_GetWriteWatch();
       return GC_GWW_AVAILABLE();
     }
 # else
-    void GC_dirty_init(void)
+    GC_INNER void GC_dirty_init(void)
     {
       detect_GetWriteWatch();
       GC_dirty_maintained = GC_GWW_AVAILABLE();
@@ -2493,7 +2494,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 # ifdef MPROTECT_VDB
     STATIC void GC_gww_read_dirty(void)
 # else
-    void GC_read_dirty(void)
+    GC_INNER void GC_read_dirty(void)
 # endif
   {
     word i;
@@ -2571,7 +2572,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 # ifdef MPROTECT_VDB
     STATIC GC_bool GC_gww_page_was_dirty(struct hblk * h)
 # else
-    GC_bool GC_page_was_dirty(struct hblk * h)
+    GC_INNER GC_bool GC_page_was_dirty(struct hblk * h)
 # endif
   {
     return HDR(h) == 0 ||
@@ -2583,7 +2584,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 # ifdef MPROTECT_VDB
     STATIC GC_bool GC_gww_page_was_ever_dirty(struct hblk * h)
 # else
-    GC_bool GC_page_was_ever_dirty(struct hblk * h)
+    GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h)
 # endif
   {
     return HDR(h) == 0 ||
@@ -2593,7 +2594,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 
 # ifndef MPROTECT_VDB
     /*ARGSUSED*/
-    void GC_remove_protection(struct hblk *h, word nblocks,
+    GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
                                        GC_bool is_ptrfree) {}
 # endif
 
@@ -2607,7 +2608,7 @@ STATIC void GC_or_pages(page_hash_table pht1, page_hash_table pht2)
 /* written.                                                             */
 
 /* Initialize virtual dirty bit implementation.                 */
-void GC_dirty_init(void)
+GC_INNER void GC_dirty_init(void)
 {
     if (GC_print_stats == VERBOSE)
       GC_log_printf("Initializing DEFAULT_VDB...\n");
@@ -2616,14 +2617,14 @@ void GC_dirty_init(void)
 
 /* Retrieve system dirty bits for heap to a local buffer.       */
 /* Restore the systems notion of which pages are dirty.         */
-void GC_read_dirty(void) {}
+GC_INNER void GC_read_dirty(void) {}
 
 /* Is the HBLKSIZE sized page at h marked dirty in the local buffer?    */
 /* If the actual page size is different, this returns TRUE if any       */
 /* of the pages overlapping h are dirty.  This routine may err on the   */
 /* side of labeling pages as dirty (and this implementation does).      */
 /*ARGSUSED*/
-GC_bool GC_page_was_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h)
 {
     return(TRUE);
 }
@@ -2638,7 +2639,7 @@ GC_bool GC_page_was_dirty(struct hblk *h)
 #if 0
 /* Could any valid GC heap pointer ever have been written to this page? */
 /*ARGSUSED*/
-GC_bool GC_page_was_ever_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h)
 {
     return(TRUE);
 }
@@ -2652,7 +2653,7 @@ GC_bool GC_page_was_ever_dirty(struct hblk *h)
 /* pointer-free system call buffers in the heap are     */
 /* not protected.                                       */
 /*ARGSUSED*/
-void GC_remove_protection(struct hblk *h, word nblocks,
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
                                    GC_bool is_ptrfree) {}
 
 # endif /* DEFAULT_VDB */
@@ -2660,7 +2661,7 @@ void GC_remove_protection(struct hblk *h, word nblocks,
 # ifdef MANUAL_VDB
 
 /* Initialize virtual dirty bit implementation.                 */
-void GC_dirty_init(void)
+GC_INNER void GC_dirty_init(void)
 {
     if (GC_print_stats == VERBOSE)
       GC_log_printf("Initializing MANUAL_VDB...\n");
@@ -2670,7 +2671,7 @@ void GC_dirty_init(void)
 
 /* Retrieve system dirty bits for heap to a local buffer.       */
 /* Restore the systems notion of which pages are dirty.         */
-void GC_read_dirty(void)
+GC_INNER void GC_read_dirty(void)
 {
     BCOPY((word *)GC_dirty_pages, GC_grungy_pages,
           (sizeof GC_dirty_pages));
@@ -2681,7 +2682,7 @@ void GC_read_dirty(void)
 /* If the actual page size is different, this returns TRUE if any       */
 /* of the pages overlapping h are dirty.  This routine may err on the   */
 /* side of labeling pages as dirty (and this implementation does).      */
-GC_bool GC_page_was_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h)
 {
     register word index;
 
@@ -2698,7 +2699,7 @@ void GC_dirty(ptr_t p)
 }
 
 /*ARGSUSED*/
-void GC_remove_protection(struct hblk *h, word nblocks,
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
                                    GC_bool is_ptrfree) {}
 
 # endif /* MANUAL_VDB */
@@ -2911,7 +2912,8 @@ void GC_remove_protection(struct hblk *h, word nblocks,
 #   endif
 
 # if defined(MSWIN32) || defined(MSWINCE)
-    LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info)
+    GC_INNER LONG WINAPI GC_write_fault_handler(
+                                struct _EXCEPTION_POINTERS *exc_info)
 # else
 #   include <ucontext.h>
     /*ARGSUSED*/
@@ -3032,7 +3034,8 @@ void GC_remove_protection(struct hblk *h, word nblocks,
  * starting at h are no longer protected.  If is_ptrfree is false,
  * also ensure that they will subsequently appear to be dirty.
  */
-void GC_remove_protection(struct hblk *h, word nblocks, GC_bool is_ptrfree)
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
+                                   GC_bool is_ptrfree)
 {
     struct hblk * h_trunc;  /* Truncated to page boundary */
     struct hblk * h_end;    /* Page boundary following block end */
@@ -3060,7 +3063,7 @@ void GC_remove_protection(struct hblk *h, word nblocks, GC_bool is_ptrfree)
 }
 
 #if !defined(DARWIN)
-  void GC_dirty_init(void)
+  GC_INNER void GC_dirty_init(void)
   {
 #   if !defined(MSWIN32) && !defined(MSWINCE)
       struct sigaction  act, oldact;
@@ -3222,7 +3225,7 @@ STATIC void GC_protect_heap(void)
 
 /* We assume that either the world is stopped or its OK to lose dirty   */
 /* bits while this is happenning (as in GC_enable_incremental).         */
-void GC_read_dirty(void)
+GC_INNER void GC_read_dirty(void)
 {
 #   if defined(GWW_VDB)
       if (GC_GWW_AVAILABLE()) {
@@ -3236,7 +3239,7 @@ void GC_read_dirty(void)
     GC_protect_heap();
 }
 
-GC_bool GC_page_was_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h)
 {
     register word index;
 
@@ -3378,7 +3381,7 @@ ssize_t read(int fd, void *buf, size_t nbyte)
 #endif
 
 /*ARGSUSED*/
-GC_bool GC_page_was_ever_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h)
 {
 #   if defined(GWW_VDB)
       if (GC_GWW_AVAILABLE())
@@ -3418,7 +3421,7 @@ STATIC char *GC_proc_buf = NULL;
 
 STATIC int GC_proc_fd = 0;
 
-void GC_dirty_init(void)
+GC_INNER void GC_dirty_init(void)
 {
     int fd;
     char buf[30];
@@ -3450,12 +3453,12 @@ void GC_dirty_init(void)
 
 /* Ignore write hints. They don't help us here. */
 /*ARGSUSED*/
-void GC_remove_protection(struct hblk *h, word nblocks,
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
                                    GC_bool is_ptrfree) {}
 
 # define READ(fd,buf,nbytes) read(fd, buf, nbytes)
 
-void GC_read_dirty(void)
+GC_INNER void GC_read_dirty(void)
 {
     unsigned long ps, np;
     int nmaps;
@@ -3525,13 +3528,13 @@ void GC_read_dirty(void)
 
 #undef READ
 
-GC_bool GC_page_was_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h)
 {
     register word index = PHT_HASH(h);
     return get_pht_entry_from_index(GC_grungy_pages, index);
 }
 
-GC_bool GC_page_was_ever_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk *h)
 {
     register word index = PHT_HASH(h);
     return get_pht_entry_from_index(GC_written_pages, index);
@@ -3552,7 +3555,7 @@ STATIC ptr_t GC_vd_base = NULL;
                         /* Address corresponding to GC_grungy_bits[0]   */
                         /* HBLKSIZE aligned.                            */
 
-void GC_dirty_init(void)
+GC_INNER void GC_dirty_init(void)
 {
     GC_dirty_maintained = TRUE;
     /* For the time being, we assume the heap generally grows up */
@@ -3566,7 +3569,7 @@ void GC_dirty_init(void)
     }
 }
 
-void GC_read_dirty(void)
+GC_INNER void GC_read_dirty(void)
 {
     /* lazily enable dirty bits on newly added heap sects */
     {
@@ -3585,7 +3588,7 @@ void GC_read_dirty(void)
     }
 }
 
-GC_bool GC_page_was_dirty(struct hblk *h)
+GC_INNER GC_bool GC_page_was_dirty(struct hblk *h)
 {
     if((ptr_t)h < GC_vd_base || (ptr_t)h >= GC_vd_base + NPAGES*HBLKSIZE) {
         return(TRUE);
@@ -3594,7 +3597,8 @@ GC_bool GC_page_was_dirty(struct hblk *h)
 }
 
 /*ARGSUSED*/
-void GC_remove_protection(struct hblk *h, word nblocks, GC_bool is_ptrfree)
+GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
+                                   GC_bool is_ptrfree)
 {
     PCR_VD_WriteProtectDisable(h, nblocks*HBLKSIZE);
     PCR_VD_WriteProtectEnable(h, nblocks*HBLKSIZE);
@@ -3730,12 +3734,12 @@ STATIC void GC_mprotect_thread_reply(void)
     ABORT("mach_msg failed in GC_mprotect_thread_reply");
 }
 
-void GC_mprotect_stop(void)
+GC_INNER void GC_mprotect_stop(void)
 {
   GC_mprotect_thread_notify(ID_STOP);
 }
 
-void GC_mprotect_resume(void)
+GC_INNER void GC_mprotect_resume(void)
 {
   GC_mprotect_thread_notify(ID_RESUME);
 }
@@ -3857,7 +3861,7 @@ STATIC void GC_darwin_sigbus(int num, siginfo_t *sip, void *context)
 }
 #endif /* BROKEN_EXCEPTION_HANDLING */
 
-void GC_dirty_init(void)
+GC_INNER void GC_dirty_init(void)
 {
   kern_return_t r;
   mach_port_t me;
@@ -4241,7 +4245,7 @@ catch_exception_raise_state_identity(mach_port_name_t exception_port,
   GC_in_save_callers = FALSE;
 #endif
 
-void GC_save_callers(struct callinfo info[NFRAMES])
+GC_INNER void GC_save_callers(struct callinfo info[NFRAMES])
 {
   void * tmp_info[NFRAMES + 1];
   int npcs, i;
@@ -4282,7 +4286,7 @@ void GC_save_callers(struct callinfo info[NFRAMES])
 #   define BIAS 0
 #endif
 
-void GC_save_callers(struct callinfo info[NFRAMES])
+GC_INNER void GC_save_callers(struct callinfo info[NFRAMES])
 {
   struct frame *frame;
   struct frame *fp;
@@ -4318,7 +4322,7 @@ void GC_save_callers(struct callinfo info[NFRAMES])
 #ifdef NEED_CALLINFO
 
 /* Print info to stderr.  We do NOT hold the allocation lock */
-void GC_print_callers(struct callinfo info[NFRAMES])
+GC_INNER void GC_print_callers(struct callinfo info[NFRAMES])
 {
     int i;
     static int reentry_count = 0;
index 321726b..7c0a6bf 100644 (file)
@@ -279,7 +279,7 @@ STATIC void GC_restart_handler(int sig)
 # endif
 /* We hold allocation lock.  Should do exactly the right thing if the   */
 /* world is stopped.  Should not fail if it isn't.                      */
-void GC_push_all_stacks(void)
+GC_INNER void GC_push_all_stacks(void)
 {
     GC_bool found_me = FALSE;
     size_t nthreads = 0;
@@ -411,7 +411,7 @@ STATIC int GC_suspend_all(void)
     return n_live_threads;
 }
 
-void GC_stop_world(void)
+GC_INNER void GC_stop_world(void)
 {
     int i;
 #   ifndef GC_OPENBSD_THREADS
@@ -497,7 +497,7 @@ void GC_stop_world(void)
 
 /* Caller holds allocation lock, and has held it continuously since     */
 /* the world stopped.                                                   */
-void GC_start_world(void)
+GC_INNER void GC_start_world(void)
 {
     pthread_t my_thread = pthread_self();
     register int i;
@@ -563,7 +563,7 @@ void GC_start_world(void)
 #    endif
 }
 
-void GC_stop_init(void)
+GC_INNER void GC_stop_init(void)
 {
 # ifndef GC_OPENBSD_THREADS
     struct sigaction act;
index d5c3953..636c393 100644 (file)
@@ -222,7 +222,7 @@ STATIC long GC_nprocs = 1;
 /* list links wouldn't otherwise be found.  We also set them in the     */
 /* normal free lists, since that involves touching less memory than if  */
 /* we scanned them normally.                                            */
-void GC_mark_thread_local_free_lists(void)
+GC_INNER void GC_mark_thread_local_free_lists(void)
 {
     int i;
     GC_thread p;
@@ -454,7 +454,7 @@ STATIC void GC_delete_gc_thread(GC_thread gc_id)
 /* updates.                                                     */
 /* If there is more than one thread with the given id we        */
 /* return the most recent one.                                  */
-GC_thread GC_lookup_thread(pthread_t id)
+GC_INNER GC_thread GC_lookup_thread(pthread_t id)
 {
     int hv = NUMERIC_THREAD_ID(id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
@@ -464,7 +464,7 @@ GC_thread GC_lookup_thread(pthread_t id)
 }
 
 /* Called by GC_finalize() (in case of an allocation failure observed). */
-void GC_reset_finalizer_nested(void)
+GC_INNER void GC_reset_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread(pthread_self());
   me->finalizer_nested = 0;
@@ -475,7 +475,7 @@ void GC_reset_finalizer_nested(void)
 /* collector (to minimize the risk of a deep finalizers recursion),     */
 /* otherwise returns a pointer to the thread-local finalizer_nested.    */
 /* Called by GC_notify_or_invoke_finalizers() only (the lock is held).  */
-unsigned *GC_check_finalizer_nested(void)
+GC_INNER unsigned *GC_check_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread(pthread_self());
   unsigned nesting_level = me->finalizer_nested;
@@ -538,7 +538,7 @@ STATIC void GC_remove_all_threads_but_me(void)
 #endif /* HANDLE_FORK */
 
 #ifdef USE_PROC_FOR_LIBRARIES
-  GC_bool GC_segment_is_thread_stack(ptr_t lo, ptr_t hi)
+  GC_INNER GC_bool GC_segment_is_thread_stack(ptr_t lo, ptr_t hi)
   {
     int i;
     GC_thread p;
@@ -571,7 +571,7 @@ STATIC void GC_remove_all_threads_but_me(void)
   /* Find the largest stack_base smaller than bound.  May be used       */
   /* to find the boundary between a register stack and adjacent         */
   /* immediately preceding memory stack.                                */
-  ptr_t GC_greatest_stack_base_below(ptr_t bound)
+  GC_INNER ptr_t GC_greatest_stack_base_below(ptr_t bound)
   {
     int i;
     GC_thread p;
@@ -771,7 +771,7 @@ STATIC void GC_fork_child_proc(void)
 #endif
 
 /* We hold the allocation lock. */
-void GC_thr_init(void)
+GC_INNER void GC_thr_init(void)
 {
 #   ifndef GC_DARWIN_THREADS
         int dummy;
@@ -899,7 +899,7 @@ void GC_thr_init(void)
 /* Called without allocation lock.                      */
 /* Must be called before a second thread is created.    */
 /* Did we say it's called without the allocation lock?  */
-void GC_init_parallel(void)
+GC_INNER void GC_init_parallel(void)
 {
     if (parallel_initialized) return;
     parallel_initialized = TRUE;
@@ -934,7 +934,7 @@ void GC_init_parallel(void)
 /* length of time.                                                      */
 
 /*ARGSUSED*/
-void GC_do_blocking_inner(ptr_t data, void * context)
+GC_INNER void GC_do_blocking_inner(ptr_t data, void * context)
 {
     struct blocking_data * d = (struct blocking_data *) data;
     GC_thread me;
@@ -1451,7 +1451,7 @@ STATIC void GC_generic_lock(pthread_mutex_t * lock)
 
 GC_INNER volatile AO_TS_t GC_allocate_lock = AO_TS_INITIALIZER;
 
-void GC_lock(void)
+GC_INNER void GC_lock(void)
 {
 #   define low_spin_max 30  /* spin cycles if we suspect uniprocessor */
 #   define high_spin_max SPIN_MAX /* spin cycles for multiprocessor */
@@ -1514,7 +1514,7 @@ yield:
 }
 
 #else  /* !USE_SPINLOCK */
-void GC_lock(void)
+GC_INNER void GC_lock(void)
 {
 #ifndef NO_PTHREAD_TRYLOCK
     if (1 == GC_nprocs || GC_collecting) {
@@ -1551,7 +1551,7 @@ void GC_lock(void)
 
 static pthread_cond_t builder_cv = PTHREAD_COND_INITIALIZER;
 
-void GC_acquire_mark_lock(void)
+GC_INNER void GC_acquire_mark_lock(void)
 {
 /*
     if (pthread_mutex_lock(&mark_mutex) != 0) {
@@ -1564,7 +1564,7 @@ void GC_acquire_mark_lock(void)
 #   endif
 }
 
-void GC_release_mark_lock(void)
+GC_INNER void GC_release_mark_lock(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #   ifdef GC_ASSERTIONS
@@ -1596,7 +1596,7 @@ STATIC void GC_wait_builder(void)
 #   endif
 }
 
-void GC_wait_for_reclaim(void)
+GC_INNER void GC_wait_for_reclaim(void)
 {
     GC_acquire_mark_lock();
     while (GC_fl_builder_count > 0) {
@@ -1605,7 +1605,7 @@ void GC_wait_for_reclaim(void)
     GC_release_mark_lock();
 }
 
-void GC_notify_all_builder(void)
+GC_INNER void GC_notify_all_builder(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
     if (pthread_cond_broadcast(&builder_cv) != 0) {
@@ -1615,7 +1615,7 @@ void GC_notify_all_builder(void)
 
 static pthread_cond_t mark_cv = PTHREAD_COND_INITIALIZER;
 
-void GC_wait_marker(void)
+GC_INNER void GC_wait_marker(void)
 {
     GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
     ASSERT_CANCEL_DISABLED();
@@ -1631,7 +1631,7 @@ void GC_wait_marker(void)
 #   endif
 }
 
-void GC_notify_all_marker(void)
+GC_INNER void GC_notify_all_marker(void)
 {
     if (pthread_cond_broadcast(&mark_cv) != 0) {
         ABORT("pthread_cond_broadcast failed");
index 2390ae1..3c52d1f 100644 (file)
--- a/reclaim.c
+++ b/reclaim.c
@@ -49,11 +49,11 @@ STATIC void GC_add_leaked(ptr_t leaked)
     }
 }
 
-static GC_bool printing_errors = FALSE;
-/* Print all objects on the list after printing any smashed objs.       */
+/* Print all objects on the list after printing any smashed objects.    */
 /* Clear both lists.                                                    */
-void GC_print_all_errors (void)
+GC_INNER void GC_print_all_errors(void)
 {
+    static GC_bool printing_errors = FALSE;
     unsigned i;
 
     LOCK();
@@ -86,14 +86,9 @@ void GC_print_all_errors (void)
  *
  */
 
-
-/*
- * Test whether a block is completely empty, i.e. contains no marked
- * objects.  This does not require the block to be in physical
- * memory.
- */
-
-GC_bool GC_block_empty(hdr *hhdr)
+/* Test whether a block is completely empty, i.e. contains no marked    */
+/* objects.  This does not require the block to be in physical memory.  */
+GC_INNER GC_bool GC_block_empty(hdr *hhdr)
 {
     return (hhdr -> hb_n_marks == 0);
 }
@@ -210,8 +205,9 @@ STATIC void GC_reclaim_check(struct hblk *hbp, hdr *hhdr, word sz)
  * Also called directly from GC_malloc_many.
  * Sz is now in bytes.
  */
-ptr_t GC_reclaim_generic(struct hblk * hbp, hdr *hhdr, size_t sz,
-                         GC_bool init, ptr_t list, signed_word *count)
+GC_INNER ptr_t GC_reclaim_generic(struct hblk * hbp, hdr *hhdr, size_t sz,
+                                  GC_bool init, ptr_t list,
+                                  signed_word *count)
 {
     ptr_t result;
 
@@ -450,7 +446,7 @@ void GC_print_free_list(int kind, size_t sz_in_granules)
     }
 }
 
-#endif /* NO_DEBUGGING */
+#endif /* !NO_DEBUGGING */
 
 /*
  * Clear all obj_link pointers in the list of free objects *flp.
@@ -474,7 +470,7 @@ STATIC void GC_clear_fl_links(void **flp)
  * Perform GC_reclaim_block on the entire heap, after first clearing
  * small object free lists (if we are not just looking for leaks).
  */
-void GC_start_reclaim(GC_bool report_if_found)
+GC_INNER void GC_start_reclaim(GC_bool report_if_found)
 {
     unsigned kind;
 
@@ -534,7 +530,7 @@ void GC_start_reclaim(GC_bool report_if_found)
  * appropriate free list is nonempty, or there are no more blocks to
  * sweep.
  */
-void GC_continue_reclaim(size_t sz /* granules */, int kind)
+GC_INNER void GC_continue_reclaim(size_t sz /* granules */, int kind)
 {
     hdr * hhdr;
     struct hblk * hbp;
@@ -561,7 +557,7 @@ void GC_continue_reclaim(size_t sz /* granules */, int kind)
  * recently reclaimed, and discard the rest.
  * Stop_func may be 0.
  */
-GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old)
+GC_INNER GC_bool GC_reclaim_all(GC_stop_func stop_func, GC_bool ignore_old)
 {
     word sz;
     unsigned kind;
index 21a1d30..1e9120d 100644 (file)
@@ -78,7 +78,7 @@ static void return_freelists(void **fl, void **gfl)
 
 /* Each thread structure must be initialized.   */
 /* This call must be made from the new thread.  */
-void GC_init_thread_local(GC_tlfs p)
+GC_INNER void GC_init_thread_local(GC_tlfs p)
 {
     int i;
 
@@ -111,7 +111,7 @@ void GC_init_thread_local(GC_tlfs p)
 }
 
 /* We hold the allocator lock.  */
-void GC_destroy_thread_local(GC_tlfs p)
+GC_INNER void GC_destroy_thread_local(GC_tlfs p)
 {
     /* We currently only do this from the thread itself or from */
     /* the fork handler for a child process.                    */
@@ -268,7 +268,7 @@ GC_API void * GC_CALL GC_gcj_malloc(size_t bytes,
 /* free lists explicitly, since the link field is often         */
 /* invisible to the marker.  It knows how to find all threads;  */
 /* we take care of an individual thread freelist structure.     */
-void GC_mark_thread_local_fls_for(GC_tlfs p)
+GC_INNER void GC_mark_thread_local_fls_for(GC_tlfs p)
 {
     ptr_t q;
     int j;
index e13b06a..6fe4feb 100644 (file)
@@ -352,12 +352,12 @@ STATIC GC_thread GC_new_thread(DWORD id)
 }
 
 #ifdef MPROTECT_VDB
-  LONG WINAPI GC_write_fault_handler(
+  GC_INNER LONG WINAPI GC_write_fault_handler(
                                 struct _EXCEPTION_POINTERS *exc_info);
 #endif
 
 #if defined(GWW_VDB) && defined(MPROTECT_VDB)
-  GC_bool GC_gww_dirty_init(void);
+  GC_INNER GC_bool GC_gww_dirty_init(void);
   /* Defined in os_dep.c.  Returns TRUE if GetWriteWatch is available.  */
   /* may be called repeatedly.                                          */
 #endif
@@ -542,7 +542,7 @@ STATIC GC_thread GC_lookup_thread_inner(DWORD thread_id)
 
 /* Called by GC_finalize() (in case of an allocation failure observed). */
 /* GC_reset_finalizer_nested() is the same as in pthread_support.c.     */
-void GC_reset_finalizer_nested(void)
+GC_INNER void GC_reset_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread_inner(GetCurrentThreadId());
   me->finalizer_nested = 0;
@@ -554,7 +554,7 @@ void GC_reset_finalizer_nested(void)
 /* otherwise returns a pointer to the thread-local finalizer_nested.    */
 /* Called by GC_notify_or_invoke_finalizers() only (the lock is held).  */
 /* GC_check_finalizer_nested() is the same as in pthread_support.c.     */
-unsigned *GC_check_finalizer_nested(void)
+GC_INNER unsigned *GC_check_finalizer_nested(void)
 {
   GC_thread me = GC_lookup_thread_inner(GetCurrentThreadId());
   unsigned nesting_level = me->finalizer_nested;
@@ -751,7 +751,7 @@ GC_API int GC_CALL GC_unregister_my_thread(void)
 
 /* GC_do_blocking_inner() is nearly the same as in pthread_support.c    */
 /*ARGSUSED*/
-void GC_do_blocking_inner(ptr_t data, void * context)
+GC_INNER void GC_do_blocking_inner(ptr_t data, void * context)
 {
   struct blocking_data * d = (struct blocking_data *) data;
   DWORD t = GetCurrentThreadId();
@@ -969,7 +969,7 @@ STATIC void GC_suspend(GC_thread t)
 # endif
 }
 
-void GC_stop_world(void)
+GC_INNER void GC_stop_world(void)
 {
   DWORD thread_id = GetCurrentThreadId();
 
@@ -1030,7 +1030,7 @@ void GC_stop_world(void)
 # endif
 }
 
-void GC_start_world(void)
+GC_INNER void GC_start_world(void)
 {
   DWORD thread_id = GetCurrentThreadId();
   int i;
@@ -1260,7 +1260,7 @@ STATIC void GC_push_stack_for(GC_thread thread)
   } /* thread looks live */
 }
 
-void GC_push_all_stacks(void)
+GC_INNER void GC_push_all_stacks(void)
 {
   DWORD me = GetCurrentThreadId();
   GC_bool found_me = FALSE;
@@ -1332,7 +1332,7 @@ void GC_push_all_stacks(void)
 /* Return stack bounds in *lo and *hi.  If no such stack        */
 /* is found, both *hi and *lo will be set to an address         */
 /* higher than limit.                                           */
-void GC_get_next_stack(char *start, char *limit,
+GC_INNER void GC_get_next_stack(char *start, char *limit,
                                 char **lo, char **hi)
 {
   int i;
@@ -1525,7 +1525,7 @@ void GC_get_next_stack(char *start, char *limit,
       AO_t GC_block_count = 0;
 #   endif
 
-    void GC_acquire_mark_lock(void)
+    GC_INNER void GC_acquire_mark_lock(void)
     {
       if (pthread_mutex_lock(&mark_mutex) != 0) {
         ABORT("pthread_mutex_lock failed");
@@ -1539,7 +1539,7 @@ void GC_get_next_stack(char *start, char *limit,
 #     endif
     }
 
-    void GC_release_mark_lock(void)
+    GC_INNER void GC_release_mark_lock(void)
     {
       GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #     ifdef GC_ASSERTIONS
@@ -1570,7 +1570,7 @@ void GC_get_next_stack(char *start, char *limit,
 #     endif
     }
 
-    void GC_wait_for_reclaim(void)
+    GC_INNER void GC_wait_for_reclaim(void)
     {
       GC_acquire_mark_lock();
       while (GC_fl_builder_count > 0) {
@@ -1579,7 +1579,7 @@ void GC_get_next_stack(char *start, char *limit,
       GC_release_mark_lock();
     }
 
-    void GC_notify_all_builder(void)
+    GC_INNER void GC_notify_all_builder(void)
     {
       GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
       if (pthread_cond_broadcast(&builder_cv) != 0) {
@@ -1589,7 +1589,7 @@ void GC_get_next_stack(char *start, char *limit,
 
     static pthread_cond_t mark_cv = PTHREAD_COND_INITIALIZER;
 
-    void GC_wait_marker(void)
+    GC_INNER void GC_wait_marker(void)
     {
       GC_ASSERT(GC_mark_lock_holder == NUMERIC_THREAD_ID(pthread_self()));
 #     ifdef GC_ASSERTIONS
@@ -1604,7 +1604,7 @@ void GC_get_next_stack(char *start, char *limit,
 #     endif
     }
 
-    void GC_notify_all_marker(void)
+    GC_INNER void GC_notify_all_marker(void)
     {
       if (pthread_cond_broadcast(&mark_cv) != 0) {
         ABORT("pthread_cond_broadcast failed");
@@ -1723,7 +1723,7 @@ void GC_get_next_stack(char *start, char *limit,
       AO_t GC_unlocked_count = 0;
 #   endif
 
-    void GC_acquire_mark_lock(void)
+    GC_INNER void GC_acquire_mark_lock(void)
     {
 #     ifdef DONT_USE_SIGNALANDWAIT
         if (InterlockedExchange(&GC_mark_mutex_state, 1 /* locked */) != 0)
@@ -1756,7 +1756,7 @@ void GC_get_next_stack(char *start, char *limit,
 #     endif
     }
 
-    void GC_release_mark_lock(void)
+    GC_INNER void GC_release_mark_lock(void)
     {
       GC_ASSERT(GC_mark_lock_holder == (unsigned long)GetCurrentThreadId());
 #     ifdef GC_ASSERTIONS
@@ -1782,7 +1782,7 @@ void GC_get_next_stack(char *start, char *limit,
     /* mark_mutex and the checked condition (GC_fl_builder_count == 0)    */
     /* is the only one for which broadcasting on builder_cv is performed. */
 
-    void GC_wait_for_reclaim(void)
+    GC_INNER void GC_wait_for_reclaim(void)
     {
       GC_ASSERT(builder_cv != 0);
       for (;;) {
@@ -1798,7 +1798,7 @@ void GC_get_next_stack(char *start, char *limit,
       GC_release_mark_lock();
     }
 
-    void GC_notify_all_builder(void)
+    GC_INNER void GC_notify_all_builder(void)
     {
       GC_ASSERT(GC_mark_lock_holder == (unsigned long)GetCurrentThreadId());
       GC_ASSERT(builder_cv != 0);
@@ -1811,7 +1811,7 @@ void GC_get_next_stack(char *start, char *limit,
 
       /* mark_cv is used (for waiting) by a non-helper thread.  */
 
-      void GC_wait_marker(void)
+      GC_INNER void GC_wait_marker(void)
       {
         HANDLE event = mark_cv;
         DWORD id = GetCurrentThreadId();
@@ -1831,7 +1831,7 @@ void GC_get_next_stack(char *start, char *limit,
         GC_acquire_mark_lock();
       }
 
-      void GC_notify_all_marker(void)
+      GC_INNER void GC_notify_all_marker(void)
       {
         DWORD id = GetCurrentThreadId();
         int i = (int)GC_markers - 1;
@@ -1870,7 +1870,7 @@ void GC_get_next_stack(char *start, char *limit,
         static SignalObjectAndWait_type signalObjectAndWait_func = 0;
 #     endif
 
-      void GC_wait_marker(void)
+      GC_INNER void GC_wait_marker(void)
       {
         /* Here we assume that GC_wait_marker() is always called        */
         /* from a while(check_cond) loop.                               */
@@ -1912,7 +1912,7 @@ void GC_get_next_stack(char *start, char *limit,
         }
       }
 
-      void GC_notify_all_marker(void)
+      GC_INNER void GC_notify_all_marker(void)
       {
         GC_ASSERT(mark_cv != 0);
         if (PulseEvent(mark_cv) == FALSE)
@@ -2154,7 +2154,7 @@ void GC_get_next_stack(char *start, char *limit,
 #endif /* GC_WINMAIN_REDIRECT */
 
 /* Called by GC_init() - we hold the allocation lock.   */
-void GC_thr_init(void)
+GC_INNER void GC_thr_init(void)
 {
   struct GC_stack_base sb;
 # ifdef GC_ASSERTIONS
@@ -2579,7 +2579,7 @@ void GC_thr_init(void)
 /* may require allocation.                              */
 /* Called without allocation lock.                      */
 /* Must be called before a second thread is created.    */
-void GC_init_parallel(void)
+GC_INNER void GC_init_parallel(void)
 {
   if (parallel_initialized) return;
   parallel_initialized = TRUE;
@@ -2612,7 +2612,7 @@ void GC_init_parallel(void)
                         /* holding the allocation lock for an           */
                         /* extended period.                             */
 
-  void GC_lock(void)
+  GC_INNER void GC_lock(void)
   {
     pthread_mutex_lock(&GC_allocate_ml);
   }
@@ -2626,7 +2626,7 @@ void GC_init_parallel(void)
   /* list links wouldn't otherwise be found.  We also set them in the     */
   /* normal free lists, since that involves touching less memory than if  */
   /* we scanned them normally.                                            */
-  void GC_mark_thread_local_free_lists(void)
+  GC_INNER void GC_mark_thread_local_free_lists(void)
   {
     int i;
     GC_thread p;