summaryrefslogtreecommitdiff
path: root/blacklst.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-10-22 17:00:59 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:51 +0200
commitc06769bfb05036d0ab57114d3b4568d8f743ad49 (patch)
treea0715b580d2c0bd3b565c6fa42109e2671bc6f0c /blacklst.c
parentbad4c7acb6060861cd4be55968c1f58b2026a747 (diff)
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. * pthread_support.c (GC_collection_in_progress): Ditto. * misc.c (GC_init_parallel): Ditto. * pthread_support.c (GC_init_parallel): Ditto. * win32_threads.c (GC_init_parallel): Ditto. * darwin_stop_world.c (GC_thr_init): Ditto. * misc.c (GC_thr_init): Ditto. * pthread_stop_world.c (GC_thr_init): Ditto. * pthread_support.c (GC_thr_init): Ditto. * blacklst.c (GC_clear_bl, GC_copy_bl, GC_number_stack_black_listed): Make STATIC. * dbg_mlc.c (GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer): Ditto. * malloc.c (GC_alloc_large_and_clear): Ditto. * mark.c (GC_push_selected, GC_push_marked1, GC_push_marked2, GC_push_marked4, GC_push_marked, GC_push_next_marked, GC_push_next_marked_dirty, GC_push_next_marked_uncollectable): Ditto. * misc.c (GC_clear_stack_inner): Ditto. * os_dep.c (GC_repeat_read, GC_default_push_other_roots): Ditto. * darwin_stop_world.c (FindTopOfStack): Make static; define only if not DARWIN_DONT_PARSE_STACK. * dbg_mlc.c (GC_debug_free_inner): Define only if DBG_HDRS_ALL. * dyn_load.c (GC_repeat_read): Remove unused prototype. * include/private/gc_pmark.h (GC_find_start): Ditto. * misc.c (GC_read, GC_register_finalizer_no_order): Ditto. * dyn_load.c (GC_segment_is_thread_stack): Add prototype (only if THREADS). * dyn_load.c (GC_register_main_static_data): Define only if DYNAMIC_LOADING. * finalize.c (GC_enqueue_all_finalizers): Remove unnecessary tail "return" statement. * gc_dlopen.c (GC_SOLARIS_THREADS): Don't recognize (since implies GC_PTHREADS). * include/gc.h: Fix a typo. * include/gc_inline.h (GC_ASSERT): Define (if not defined) since the header is public. * include/gc_inline.h (GC_generic_malloc_many): New public function declaration. * mallocx.c (GC_generic_malloc_many): Make public. * include/private/gc_priv.h (GC_INNER): Use visibility attribute (if available). * include/private/gc_priv.h (GC_EXTERN): Define using GC_INNER. * include/private/gc_priv.h: Include atomic_ops.h if THREADS and MPROTECT_VDB. * os_dep.c: Don't include atomic_ops.h * win32_threads.c: Ditto. * include/private/gc_priv.h (GC_push_selected, GC_push_regs, GC_push_marked, GC_number_stack_black_listed, GC_alloc_large_and_clear, GC_reclaim_or_delete_all, GC_generic_malloc_many, GC_make_closure, GC_debug_invoke_finalizer, GC_print_obj, GC_page_was_ever_dirty): Remove the prototype. * mark.c (GC_page_was_ever_dirty): Add prototype (only if PROC_VDB). * include/private/gc_priv.h (GC_push_next_marked_dirty, GC_push_next_marked, GC_push_next_marked_uncollectable): Move the prototype to mark.c. * include/private/gc_priv.h (GC_is_static_root): Declare only if not THREADS. * include/private/gc_priv.h (GC_free_inner): Declare only if THREADS. * include/private/gc_priv.h (GC_debug_free_inner): Declare only if THREADS and DBG_HDRS_ALL. * include/private/gc_priv.h (GC_markers): Declare GC_markers only if PARALLEL_MARK. * include/private/gc_priv.h (GC_register_main_static_data): Move the prototype to misc.c. * mach_dep.c (GC_push_regs): Make STATIC; define only along with HAVE_PUSH_REGS definition. * mach_dep.c (GC_clear_stack_inner): Replace K&R-style function definition with the ANSI C one. * mark.c (GC_started_thread_while_stopped): Declared only if not GNU C. * win32_threads.c (GC_started_thread_while_stopped): Don't define if GNU C. * mark.c (GC_mark_from): Avoid unbalanced brackets in #if-#else-#endif blocks. * mark_rts.c (GC_is_static_root): Define only if not THREADS. * os_dep.c (GC_get_stack_base): Make public (for OpenBSD). * os_dep.c (GC_page_was_ever_dirty): Comment out the function except for PROC_VDB. * tests/test.c (main): Don't reference GC_print_obj, GC_make_closure, GC_debug_invoke_finalizer, GC_page_was_ever_dirty, GC_is_fresh (in GC_noop). * thread_local_alloc.c: Don't include "gc_inline.h". * win32_threads.c (GC_write_fault_handler): Declare only if MPROTECT_VDB.
Diffstat (limited to 'blacklst.c')
-rw-r--r--blacklst.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/blacklst.c b/blacklst.c
index d0dcf45..80583a4 100644
--- a/blacklst.c
+++ b/blacklst.c
@@ -52,12 +52,11 @@ STATIC word GC_total_stack_black_listed = 0;
GC_INNER word GC_black_list_spacing = MINHINCR * HBLKSIZE;
/* Initial rough guess. */
-void GC_clear_bl(word *);
+STATIC void GC_clear_bl(word *);
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,
(unsigned long)GC_size(base));
}
@@ -109,12 +108,12 @@ void GC_bl_init(void)
GC_clear_bl(GC_incomplete_stack_bl);
}
-void GC_clear_bl(word *doomed)
+STATIC void GC_clear_bl(word *doomed)
{
BZERO(doomed, sizeof(page_hash_table));
}
-void GC_copy_bl(word *old, word *new)
+STATIC void GC_copy_bl(word *old, word *new)
{
BCOPY(old, new, sizeof(page_hash_table));
}
@@ -237,7 +236,7 @@ struct hblk * GC_is_black_listed(struct hblk *h, word len)
}
}
- for (i = 0; ; ) {
+ for (i = 0;;) {
if (GC_old_stack_bl[divWORDSZ(index)] == 0
&& GC_incomplete_stack_bl[divWORDSZ(index)] == 0) {
/* An easy case */
@@ -255,11 +254,11 @@ struct hblk * GC_is_black_listed(struct hblk *h, word len)
return(0);
}
-
/* Return the number of blacklisted blocks in a given range. */
/* Used only for statistical purposes. */
/* Looks only at the GC_incomplete_stack_bl. */
-word GC_number_stack_black_listed(struct hblk *start, struct hblk *endp1)
+STATIC word GC_number_stack_black_listed(struct hblk *start,
+ struct hblk *endp1)
{
register struct hblk * h;
word result = 0;
@@ -272,7 +271,6 @@ word GC_number_stack_black_listed(struct hblk *start, struct hblk *endp1)
return(result);
}
-
/* Return the total number of (stack) black-listed bytes. */
static word total_stack_black_listed(void)
{