summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-31 17:27:11 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:07:00 +0200
commit00b9b2b2b07d10d16bdfe6bdd7614e3064b0cc29 (patch)
treecc5bbc42963ef5597c03366c2a2603f6345d2fe0 /include
parent52dd481a53d751d0557b7d0daa5fb2a6b55b7ab2 (diff)
2011-05-31 Ivan Maidanski <ivmai@mail.ru>
* alloc.c (GC_add_current_malloc_heap, GC_build_back_graph, GC_traverse_back_graph): Move prototype to gc_priv.h. * checksums.c (GC_page_was_ever_dirty): 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, GC_store_debug_info): Ditto. * malloc.c (GC_extend_size_map, GC_text_mapping): 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_initialize_offsets, GC_bl_init, GC_do_blocking_inner, GC_bl_init_no_interiors): Ditto. * os_dep.c (GC_greatest_stack_base_below, GC_push_all_stacks): Ditto. * reclaim.c (GC_check_leaked): Ditto. * win32_threads.c (GC_gww_dirty_init): Ditto. * darwin_stop_world.c (GC_is_mach_marker, GC_mprotect_stop, GC_mprotect_resume): Move prototype to darwin_stop_world.h. * pthread_support.c (GC_FindTopOfStack): Ditto. * dyn_load.c (GC_cond_add_roots): Merge adjacent definitions. * mark.c (GC_page_was_ever_dirty): Remove (as already declared). * mark_rts.c (GC_roots_present): Change return type to void pointer (to match the prototype); return NULL instead of FALSE. * mark_rts.c (GC_add_roots_inner): Cast GC_roots_present() result. * os_dep.c (NEED_PROC_MAPS): Move definition to gcconfig.h. * os_dep.c (GC_write_fault_handler): Make STATIC. * os_dep.c (GC_set_write_fault_handler): New function (only if GC_WIN32_THREADS). * pthread_start.c (GC_start_rtn_prepare_thread, GC_thread_exit_proc): Move prototype to pthread_support.h. * pthread_support.c (GC_nacl_initialize_gc_thread, GC_nacl_shutdown_gc_thread, GC_unblock_gc_signals): Ditto. * pthread_support.c (GC_stop_init): Move prototype to pthread_stop_world.h. * thread_local_alloc.c (GC_check_tls_for): Reformat comment. * win32_threads.c (GC_write_fault_handler): Remove prototype. * win32_threads.c (GC_register_my_thread_inner): Call GC_set_write_fault_handler instead of SetUnhandledExceptionFilter (only if MPROTECT_VDB). * doc/README.win32: Add information about DMC. * include/private/gc_priv.h (GC_set_write_fault_handler): New prototype (only if GC_WIN32_THREADS and MPROTECT_VDB).
Diffstat (limited to 'include')
-rw-r--r--include/private/darwin_stop_world.h13
-rw-r--r--include/private/gc_priv.h104
-rw-r--r--include/private/gcconfig.h5
-rw-r--r--include/private/pthread_stop_world.h2
-rw-r--r--include/private/pthread_support.h19
5 files changed, 139 insertions, 4 deletions
diff --git a/include/private/darwin_stop_world.h b/include/private/darwin_stop_world.h
index ee60114..399304e 100644
--- a/include/private/darwin_stop_world.h
+++ b/include/private/darwin_stop_world.h
@@ -30,4 +30,17 @@ struct thread_stop_info {
ptr_t stack_ptr; /* Valid only when thread is in a "blocked" state. */
};
+#ifndef DARWIN_DONT_PARSE_STACK
+ GC_INNER ptr_t GC_FindTopOfStack(unsigned long);
+#endif
+
+#ifdef MPROTECT_VDB
+ GC_INNER void GC_mprotect_stop(void);
+ GC_INNER void GC_mprotect_resume(void);
+#endif
+
+#if defined(PARALLEL_MARK) && !defined(GC_NO_THREADS_DISCOVERY)
+ GC_INNER GC_bool GC_is_mach_marker(thread_act_t);
+#endif
+
#endif
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index 8ff8c0f..eb40fdc 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -1267,8 +1267,10 @@ GC_EXTERN word GC_page_size;
#if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
struct _SYSTEM_INFO;
GC_EXTERN struct _SYSTEM_INFO GC_sysinfo;
+ GC_INNER GC_bool GC_is_heap_base(ptr_t p);
#endif
+
GC_EXTERN word GC_black_list_spacing;
/* Average number of bytes between blacklisted */
/* blocks. Approximate. */
@@ -1794,6 +1796,7 @@ GC_EXTERN void (*GC_print_heap_obj)(ptr_t p);
/* Do not immediately deallocate object on */
/* free() in the leak-finding mode, just mark */
/* it as freed (and deallocate it after GC). */
+ GC_INNER GC_bool GC_check_leaked(ptr_t base); /* from dbg_mlc.c */
#endif
GC_EXTERN GC_bool GC_have_errors; /* We saw a smashed or leaked object. */
@@ -2008,6 +2011,7 @@ GC_EXTERN signed_word GC_bytes_found;
#ifdef THREAD_LOCAL_ALLOC
GC_EXTERN GC_bool GC_world_stopped; /* defined in alloc.c */
+ GC_INNER void GC_mark_thread_local_free_lists(void);
#endif
#ifdef GC_GCJ_SUPPORT
@@ -2017,6 +2021,106 @@ GC_EXTERN signed_word GC_bytes_found;
GC_EXTERN ptr_t * GC_gcjobjfreelist;
#endif
+#if defined(GWW_VDB) && defined(MPROTECT_VDB)
+ 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
+
+#if defined(CHECKSUMS) || defined(PROC_VDB)
+ GC_INNER GC_bool GC_page_was_ever_dirty(struct hblk * h);
+ /* Could the page contain valid heap pointers? */
+#endif
+
+GC_INNER void GC_default_print_heap_obj_proc(ptr_t p);
+
+GC_INNER void GC_extend_size_map(size_t); /* in misc.c */
+
+GC_INNER void GC_setpagesize(void);
+
+GC_INNER void GC_initialize_offsets(void); /* defined in obj_map.c */
+
+GC_INNER void GC_bl_init(void);
+GC_INNER void GC_bl_init_no_interiors(void); /* defined in blacklst.c */
+
+GC_INNER void GC_start_debugging(void); /* defined in dbg_mlc.c */
+
+/* Store debugging info into p. Return displaced pointer. */
+/* Assumes we don't hold allocation lock. */
+GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
+ int linenum);
+
+#ifdef REDIRECT_MALLOC
+# ifdef GC_LINUX_THREADS
+ GC_INNER GC_bool GC_text_mapping(char *nm, ptr_t *startp, ptr_t *endp);
+ /* from os_dep.c */
+# endif
+#elif defined(MSWIN32) || defined(MSWINCE)
+ GC_INNER void GC_add_current_malloc_heap(void);
+#endif /* !REDIRECT_MALLOC */
+
+#ifdef MAKE_BACK_GRAPH
+ GC_INNER void GC_build_back_graph(void);
+ GC_INNER void GC_traverse_back_graph(void);
+#endif
+
+#ifdef MSWIN32
+ GC_INNER void GC_init_win32(void);
+#endif
+
+#if !defined(MSWIN32) && !defined(MSWINCE) && !defined(CYGWIN32)
+ 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. */
+#endif
+
+#ifdef GC_WIN32_THREADS
+ GC_INNER void GC_get_next_stack(char *start, char * limit, char **lo,
+ char **hi);
+# ifdef MPROTECT_VDB
+ GC_INNER void GC_set_write_fault_handler(void);
+# endif
+#endif /* GC_WIN32_THREADS */
+
+#ifdef THREADS
+ GC_INNER void GC_reset_finalizer_nested(void);
+ GC_INNER unsigned char *GC_check_finalizer_nested(void);
+ GC_INNER void GC_do_blocking_inner(ptr_t data, void * context);
+ GC_INNER void GC_push_all_stacks(void);
+# ifdef USE_PROC_FOR_LIBRARIES
+ GC_INNER GC_bool GC_segment_is_thread_stack(ptr_t lo, ptr_t hi);
+# endif
+# ifdef IA64
+ GC_INNER ptr_t GC_greatest_stack_base_below(ptr_t bound);
+# endif
+#endif /* THREADS */
+
+#ifdef DYNAMIC_LOADING
+ GC_INNER GC_bool GC_register_main_static_data(void);
+# ifdef DARWIN
+ GC_INNER void GC_init_dyld(void);
+# endif
+#endif /* DYNAMIC_LOADING */
+
+#ifdef SEARCH_FOR_DATA_START
+ GC_INNER void GC_init_linux_data_start(void);
+#endif
+
+#if defined(NETBSD) && defined(__ELF__)
+ GC_INNER void GC_init_netbsd_elf(void);
+#endif
+
+#ifdef UNIX_LIKE
+ GC_INNER void GC_set_and_save_fault_handler(void (*handler)(int));
+#endif
+
+#ifdef NEED_PROC_MAPS
+ 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);
+ GC_INNER char *GC_get_maps(void); /* from os_dep.c */
+#endif
+
#ifdef GC_ASSERTIONS
# define GC_ASSERT(expr) \
if (!(expr)) { \
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index bd99e6d..81c77d6 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -2451,6 +2451,11 @@
# endif
#endif
+#if defined(LINUX) && (defined(USE_PROC_FOR_LIBRARIES) || defined(IA64) \
+ || !defined(SMALL_CONFIG))
+# define NEED_PROC_MAPS
+#endif
+
#if defined(LINUX) || defined(HURD) || defined(__GLIBC__)
# define REGISTER_LIBRARIES_EARLY
/* We sometimes use dl_iterate_phdr, which may acquire an internal */
diff --git a/include/private/pthread_stop_world.h b/include/private/pthread_stop_world.h
index c883c3c..cb67d23 100644
--- a/include/private/pthread_stop_world.h
+++ b/include/private/pthread_stop_world.h
@@ -39,4 +39,6 @@ struct thread_stop_info {
# endif
};
+GC_INNER void GC_stop_init(void);
+
#endif
diff --git a/include/private/pthread_support.h b/include/private/pthread_support.h
index 2b16bd5..ba0f693 100644
--- a/include/private/pthread_support.h
+++ b/include/private/pthread_support.h
@@ -30,7 +30,7 @@
#ifdef THREAD_LOCAL_ALLOC
# include "thread_local_alloc.h"
-#endif /* THREAD_LOCAL_ALLOC */
+#endif
/* We use the allocation lock to protect thread-related data structures. */
@@ -126,9 +126,20 @@ GC_EXTERN GC_bool GC_in_thread_creation;
/* Only set to TRUE while allocation lock is held. */
/* When set, it is OK to run GC from unknown thread. */
-# ifdef NACL
- GC_EXTERN __thread GC_thread GC_nacl_gc_thread_self;
-# endif
+#ifdef NACL
+ GC_EXTERN __thread GC_thread GC_nacl_gc_thread_self;
+ GC_INNER void GC_nacl_initialize_gc_thread(void);
+ GC_INNER void GC_nacl_shutdown_gc_thread(void);
+#endif
+
+#ifdef GC_EXPLICIT_SIGNALS_UNBLOCK
+ GC_INNER void GC_unblock_gc_signals(void);
+#endif
+
+GC_INNER GC_thread GC_start_rtn_prepare_thread(void *(**pstart)(void *),
+ void **pstart_arg,
+ struct GC_stack_base *sb, void *arg);
+GC_INNER void GC_thread_exit_proc(void *);
#endif /* GC_PTHREADS && !GC_WIN32_THREADS */