2009-10-18 Ivan Maidanski <ivmai@mail.ru>
+ * allchblk.c (GC_fail_count, GC_large_alloc_warn_interval): Move
+ the variable declaration to gc_priv.h.
+ * alloc.c (GC_bytes_found, GC_unmap_threshold,
+ GC_force_unmap_on_gcollect): Ditto.
+ * dyn_load.c (GC_no_win32_dlls, GC_wnt): Ditto.
+ * finalize.c (GC_fail_count): Ditto.
+ * include/private/gc_locks.h (GC_allocate_ml, GC_lock_holder,
+ GC_collecting, GC_mark_lock_holder, GC_need_to_lock): Ditto.
+ * include/private/gc_pmark.h (GC_n_mark_procs, GC_mark_stack_size,
+ GC_mark_stack_limit, GC_mark_stack_top, GC_mark_stack,
+ GC_mark_stack_too_small, GC_mark_state): Ditto.
+ * include/private/pthread_support.h (GC_threads,
+ GC_thr_initialized, GC_in_thread_creation): Ditto.
+ * mallocx.c (GC_bytes_found): Ditto.
+ * mark_rts.c (GC_save_regs_ret_val, GC_world_stopped): Ditto.
+ * misc.c (GC_unmap_threshold): Ditto.
+ * os_dep.c (GC_unmap_threshold): Ditto.
+ * pthread_support.c (GC_markers): Ditto.
+ * thread_local_alloc.c (GC_gcjobjfreelist,
+ GC_gcj_malloc_initialized, GC_gcj_kind): Ditto.
+ * win32_threads.c (GC_fault_handler_lock, GC_write_cs,
+ GC_dont_query_stack_min, GC_markers, GC_wnt): Ditto.
+ * include/private/gc_priv.h (GC_EXTERN): New macro (used mostly as
+ a tag for now); defined after "gcconfig.h" inclusion.
+ * include/private/gc_priv.h: Use GC_EXTERN instead of "extern"
+ keyword for most global variables.
+ * alloc.c (GC_copyright): Add the comment about the symbol
+ visibility.
+ * finalize.c (GC_fo_entries): Ditto.
+ * include/private/gc_priv.h (GC_print_stats): Ditto.
+ * misc.c (GC_quiet): Ditto.
+ * mallocx.c (GC_bytes_allocd_tmp): Make the volatile variable
+ STATIC.
+ * pthread_support.c (GC_threads): Add explicit zero initializer
+ (to make the variable definition differ from the declaration).
+
+2009-10-18 Ivan Maidanski <ivmai@mail.ru>
+
* backgraph.c (GC_quiet): Remove the declaration (not needed
anymore since gc_priv.h is always included).
* checksums.c (GC_quiet): Ditto.
return 0;
}
-extern unsigned GC_fail_count; /* defined in alloc.c */
-
-extern long GC_large_alloc_warn_interval; /* defined in misc.c */
-
STATIC long GC_large_alloc_warn_suppressed = 0;
/* Number of warnings suppressed so far. */
STATIC word GC_used_heap_size_after_full = 0;
+/* GC_copyright symbol is externally visible. */
char * const GC_copyright[] =
{"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers ",
"Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. ",
/* some more variables */
-extern signed_word GC_bytes_found;
- /* Number of reclaimed bytes */
- /* after garbage collection; */
- /* defined in reclaim.c. */
-
#ifdef GC_DONT_EXPAND
GC_bool GC_dont_expand = TRUE;
#else
# endif
}
-#ifdef USE_MUNMAP
- extern int GC_unmap_threshold; /* defined in allchblk.c */
- extern GC_bool GC_force_unmap_on_gcollect; /* defined in misc.c */
-#endif
-
/* If stop_func == 0 then GC_default_stop_func is used instead. */
STATIC GC_bool GC_try_to_collect_general(GC_stop_func stop_func,
GC_bool force_unmap)
}
# endif
+GC_bool GC_register_main_static_data(void)
+{
# ifdef MSWINCE
/* Do we need to separately register the main static data segment? */
- GC_bool GC_register_main_static_data(void)
- {
- return FALSE;
- }
-# else /* win32 */
- extern GC_bool GC_no_win32_dlls; /* defined in os_dep.c */
-
- GC_bool GC_register_main_static_data(void)
- {
- return GC_no_win32_dlls;
- }
-# endif /* win32 */
+ return FALSE;
+# else
+ return GC_no_win32_dlls;
+# endif
+}
# define HAVE_REGISTER_MAIN_STATIC_DATA
/* a "Data Abort" message to the debugging console). */
/* To workaround that, use -DGC_REGISTER_MEM_PRIVATE. */
# define GC_wnt TRUE
-# else
- extern GC_bool GC_wnt; /* Is Windows NT derivative. */
- /* Defined and set in os_dep.c. */
# endif
void GC_register_dynamic_libraries(void)
static signed_word log_fo_table_size = -1;
-word GC_fo_entries = 0;
+word GC_fo_entries = 0; /* used also in extra/MacOS.c */
void GC_push_finalizer_structures(void)
{
STATIC word GC_old_dl_entries = 0; /* for stats printing */
#endif
-extern unsigned GC_fail_count;
- /* How many consecutive GC/expansion failures? */
- /* Reset by GC_allochblk(); defined in alloc.c. */
-
#ifdef THREADS
/* Defined in pthread_support.c or win32_threads.c. Called with the */
/* allocation lock held. */
# ifdef PCR
# include <base/PCR_Base.h>
# include <th/PCR_Th.h>
- extern PCR_Th_ML GC_allocate_ml;
+ GC_EXTERN PCR_Th_ML GC_allocate_ml;
# define DCL_LOCK_STATE \
PCR_ERes GC_fastLockRes; PCR_sigset_t GC_old_sig_mask
# define UNCOND_LOCK() PCR_Th_ML_Acquire(&GC_allocate_ml)
# if defined(GC_WIN32_THREADS) && !defined(USE_PTHREAD_LOCKS)
# include <windows.h>
# define NO_THREAD (DWORD)(-1)
- extern DWORD GC_lock_holder;
- extern CRITICAL_SECTION GC_allocate_ml;
+ GC_EXTERN DWORD GC_lock_holder;
+ GC_EXTERN CRITICAL_SECTION GC_allocate_ml;
# ifdef GC_ASSERTIONS
# define UNCOND_LOCK() \
{ EnterCriticalSection(&GC_allocate_ml); \
/* and sleeping for fixed periods are likely to result in */
/* significant wasted time. We thus rely mostly on queued locks. */
# define USE_SPIN_LOCK
- extern volatile AO_TS_t GC_allocate_lock;
+ GC_EXTERN volatile AO_TS_t GC_allocate_lock;
void GC_lock(void);
/* Allocation lock holder. Only set if acquired by client through */
/* GC_call_with_alloc_lock. */
# endif /* THREAD_LOCAL_ALLOC || USE_PTHREAD_LOCK */
# ifdef USE_PTHREAD_LOCKS
# include <pthread.h>
- extern pthread_mutex_t GC_allocate_ml;
+ GC_EXTERN pthread_mutex_t GC_allocate_ml;
# ifdef GC_ASSERTIONS
# define UNCOND_LOCK() \
{ GC_lock(); \
(!GC_need_to_lock \
|| GC_lock_holder != NUMERIC_THREAD_ID(pthread_self()))
# endif
- extern volatile GC_bool GC_collecting;
+ GC_EXTERN volatile GC_bool GC_collecting;
# define ENTER_GC() GC_collecting = 1;
# define EXIT_GC() GC_collecting = 0;
void GC_lock(void);
- extern unsigned long GC_lock_holder;
+ GC_EXTERN unsigned long GC_lock_holder;
# ifdef GC_ASSERTIONS
- extern unsigned long GC_mark_lock_holder;
+ GC_EXTERN unsigned long GC_mark_lock_holder;
# endif
# endif /* GC_PTHREADS with linux_threads.c implementation */
# endif /* !THREADS */
#if defined(UNCOND_LOCK) && !defined(LOCK)
- extern GC_bool GC_need_to_lock;
+ GC_EXTERN GC_bool GC_need_to_lock;
/* At least two thread running; need to lock. */
# define LOCK() if (GC_need_to_lock) { UNCOND_LOCK(); }
# define UNLOCK() if (GC_need_to_lock) { UNCOND_UNLOCK(); }
# define MAX_ENV \
(((word)1 << (WORDSZ - GC_DS_TAG_BITS - GC_LOG_MAX_MARK_PROCS)) - 1)
-extern unsigned GC_n_mark_procs;
+GC_EXTERN unsigned GC_n_mark_procs;
/* Number of mark stack entries to discard on overflow. */
#define GC_MARK_STACK_DISCARDS (INITIAL_MARK_STACK_SIZE/8)
/* as described in gc_mark.h. */
} mse;
-extern size_t GC_mark_stack_size;
+GC_EXTERN size_t GC_mark_stack_size;
-extern mse * GC_mark_stack_limit;
+GC_EXTERN mse * GC_mark_stack_limit;
#ifdef PARALLEL_MARK
- extern mse * volatile GC_mark_stack_top;
+ GC_EXTERN mse * volatile GC_mark_stack_top;
#else
- extern mse * GC_mark_stack_top;
+ GC_EXTERN mse * GC_mark_stack_top;
#endif
-extern mse * GC_mark_stack;
+GC_EXTERN mse * GC_mark_stack;
#ifdef PARALLEL_MARK
/*
} \
}
-extern GC_bool GC_mark_stack_too_small;
+GC_EXTERN GC_bool GC_mark_stack_too_small;
/* We need a larger mark stack. May be */
/* set by client supplied mark routines.*/
# define MS_INVALID 5 /* I may not hold. */
-extern mark_state_t GC_mark_state;
+GC_EXTERN mark_state_t GC_mark_state;
#endif /* GC_PMARK_H */
* modified is included with the above copyright notice.
*/
-
# ifndef GC_PRIVATE_H
# define GC_PRIVATE_H
/* byte displacements and which can be used */
/* for address comparisons. */
-# ifndef GCCONFIG_H
-# include "gcconfig.h"
-# endif
+#ifndef GCCONFIG_H
+# include "gcconfig.h"
+#endif
-# ifndef HEADERS_H
-# include "gc_hdrs.h"
+#ifndef GC_EXTERN
+ /* Used only for the GC-scope variables (prefixed with "GC_") */
+ /* declared in the header files. Must not be used for thread-local */
+ /* variables. Must not be used in gcconfig.h. Shouldn't be used for */
+ /* the debugging-only or profiling-only variables. Currently, not */
+ /* used for the variables accessed from the "dated" source files */
+ /* (pcr_interface.c, specific.c/h, and in the "extra" folder). */
+# if defined(GC_DLL) && defined(__GNUC__) && !defined(MSWIN32) \
+ && !defined(MSWINCE)
+# if __GNUC__ >= 4
+ /* See the corresponding GC_API definition. */
+# define GC_EXTERN extern __attribute__((__visibility__("hidden")))
+# else
+ /* The attribute is unsupported. */
+# define GC_EXTERN extern
+# endif
+# else
+# define GC_EXTERN extern
# endif
+#endif
+
+#ifndef HEADERS_H
+# include "gc_hdrs.h"
+#endif
#if __GNUC__ >= 3
# define EXPECT(expr, outcome) __builtin_expect(expr,outcome)
# endif
/* Print warning message, e.g. almost out of memory. */
-# define WARN(msg,arg) (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg))
-extern GC_warn_proc GC_current_warn_proc;
+#define WARN(msg, arg) (*GC_current_warn_proc)("GC Warning: " msg, \
+ (GC_word)(arg))
+GC_EXTERN GC_warn_proc GC_current_warn_proc;
/* Print format type macro for signed_word. Currently used for WARN() */
/* only. This could be of use on Win64 but commented out since Win64 */
/* Object kinds: */
# define MAXOBJKINDS 16
-extern struct obj_kind {
+GC_EXTERN struct obj_kind {
void **ok_freelist; /* Array of free listheaders for this kind of object */
/* Point either to GC_arrays or to storage allocated */
/* with GC_scratch_alloc. */
/* introduce maintenance problems. */
#ifdef SEPARATE_GLOBALS
- extern word GC_bytes_allocd;
+ GC_EXTERN word GC_bytes_allocd;
/* Number of words allocated during this collection cycle */
- extern ptr_t GC_objfreelist[MAXOBJGRANULES+1];
+ GC_EXTERN ptr_t GC_objfreelist[MAXOBJGRANULES+1];
/* free list for NORMAL objects */
# define beginGC_objfreelist ((ptr_t)(&GC_objfreelist))
# define endGC_objfreelist (beginGC_objfreelist + sizeof(GC_objfreelist))
- extern ptr_t GC_aobjfreelist[MAXOBJGRANULES+1];
+ GC_EXTERN ptr_t GC_aobjfreelist[MAXOBJGRANULES+1];
/* free list for atomic (PTRFREE) objs */
# define beginGC_aobjfreelist ((ptr_t)(&GC_aobjfreelist))
# define endGC_aobjfreelist (beginGC_aobjfreelist + sizeof(GC_aobjfreelist))
# define IS_UNCOLLECTABLE(k) ((k) == UNCOLLECTABLE)
# endif
-extern unsigned GC_n_kinds;
-
-extern word GC_fo_entries;
+GC_EXTERN unsigned GC_n_kinds;
-extern word GC_n_heap_sects; /* Number of separately added heap */
+GC_EXTERN word GC_n_heap_sects; /* Number of separately added heap */
/* sections. */
#ifdef USE_PROC_FOR_LIBRARIES
- extern word GC_n_memory; /* Number of GET_MEM allocated memory */
+ GC_EXTERN word GC_n_memory; /* Number of GET_MEM allocated memory */
/* sections. */
#endif
-extern word GC_page_size;
+GC_EXTERN word GC_page_size;
#if defined(MSWIN32) || defined(MSWINCE)
struct _SYSTEM_INFO;
- extern struct _SYSTEM_INFO GC_sysinfo;
+ GC_EXTERN struct _SYSTEM_INFO GC_sysinfo;
#endif
-extern word GC_black_list_spacing;
+GC_EXTERN word GC_black_list_spacing;
/* Average number of bytes between blacklisted */
/* blocks. Approximate. */
/* Counts only blocks that are */
/* "stack-blacklisted", i.e. that are */
/* problematic in the interior of an object. */
-extern GC_bool GC_objects_are_marked; /* There are marked objects in */
- /* the heap. */
+GC_EXTERN GC_bool GC_objects_are_marked; /* There are marked objects in */
+ /* the heap. */
#ifndef SMALL_CONFIG
- extern GC_bool GC_incremental;
+ GC_EXTERN GC_bool GC_incremental;
/* Using incremental/generational collection. */
# define TRUE_INCREMENTAL \
(GC_incremental && GC_time_limit != GC_TIME_UNLIMITED)
# define TRUE_INCREMENTAL FALSE
#endif
-extern GC_bool GC_dirty_maintained;
+GC_EXTERN GC_bool GC_dirty_maintained;
/* Dirty bits are being maintained, */
/* either for incremental collection, */
/* or to limit the root set. */
-extern word GC_root_size; /* Total size of registered root sections. */
+GC_EXTERN word GC_root_size; /* Total size of registered root sections. */
-extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called */
+GC_EXTERN GC_bool GC_debugging_started;
+ /* GC_debug_malloc has been called. */
/* This is used by GC_do_blocking[_inner](). */
struct blocking_data {
void GC_push_all_stack_frames(ptr_t lo, ptr_t hi,
struct GC_activation_frame_s *activation_frame);
#else
- extern ptr_t GC_blocked_sp;
- extern struct GC_activation_frame_s *GC_activation_frame;
+ GC_EXTERN ptr_t GC_blocked_sp;
+ GC_EXTERN struct GC_activation_frame_s *GC_activation_frame;
/* Points to the "frame" data held in stack by */
/* the innermost GC_call_with_gc_active(). */
/* NULL if no such "frame" active. */
void GC_push_roots(GC_bool all, ptr_t cold_gc_frame);
/* Push all or dirty roots. */
-extern void (*GC_push_other_roots)(void);
+GC_EXTERN void (*GC_push_other_roots)(void);
/* Push system or application specific roots */
/* onto the mark stack. In some environments */
/* (e.g. threads environments) this is */
#ifdef THREADS
void GC_push_thread_structures(void);
#endif
-extern void (*GC_push_typed_structures)(void);
+GC_EXTERN void (*GC_push_typed_structures)(void);
/* A pointer such that we can avoid linking in */
/* the typed allocation support if unused. */
# define GC_gcollect_inner() \
(void) GC_try_to_collect_inner(GC_never_stop_func)
-extern GC_bool GC_is_initialized; /* GC_init() has been run. */
+GC_EXTERN GC_bool GC_is_initialized; /* GC_init() has been run. */
#if defined(MSWIN32) || defined(MSWINCE)
void GC_deinit(void);
/* P points to somewhere inside an object with */
/* debugging info. Print a human readable */
/* description of the object to stderr. */
-extern void (*GC_check_heap)(void);
+GC_EXTERN void (*GC_check_heap)(void);
/* Check that all objects in the heap with */
/* debugging info are intact. */
/* Add any that are not to GC_smashed list. */
-extern void (*GC_print_all_smashed)(void);
+GC_EXTERN void (*GC_print_all_smashed)(void);
/* Print GC_smashed if it's not empty. */
/* Clear GC_smashed list. */
void GC_print_all_errors(void);
/* Print smashed and leaked objects, if any. */
/* Clear the lists of such objects. */
-extern void (*GC_print_heap_obj)(ptr_t p);
+GC_EXTERN void (*GC_print_heap_obj)(ptr_t p);
/* If possible print s followed by a more */
/* detailed description of the object */
/* referred to by p. */
/* Print an address map of the process. */
#endif
-extern GC_bool GC_have_errors; /* We saw a smashed or leaked object. */
- /* Call error printing routine */
- /* occasionally. */
+GC_EXTERN GC_bool GC_have_errors; /* We saw a smashed or leaked object. */
+ /* Call error printing routine */
+ /* occasionally. */
#ifndef SMALL_CONFIG
+ /* GC_print_stats should be visible outside the GC in some cases. */
extern int GC_print_stats; /* Nonzero generates basic GC log. */
/* VERBOSE generates add'l messages. */
#else
# define GC_print_stats 0
- /* Will this keep the message character strings from the executable? */
- /* It should ... */
+ /* Will this remove the message character strings from the executable? */
+ /* With a particular level of optimizations, it should... */
#endif
#define VERBOSE 2
#ifndef NO_DEBUGGING
- extern GC_bool GC_dump_regularly; /* Generate regular debugging dumps */
+ GC_EXTERN GC_bool GC_dump_regularly;
+ /* Generate regular debugging dumps. */
# define COND_DUMP if (GC_dump_regularly) GC_dump();
#else
# define COND_DUMP
#endif
#ifdef KEEP_BACK_PTRS
- extern long GC_backtraces;
+ GC_EXTERN long GC_backtraces;
void GC_generate_random_backtrace_no_gc(void);
#endif
-extern GC_bool GC_print_back_height;
+GC_EXTERN GC_bool GC_print_back_height;
#ifdef MAKE_BACK_GRAPH
void GC_print_back_graph_stats(void);
/* newlines, don't ... */
#endif
+GC_EXTERN unsigned GC_fail_count;
+ /* How many consecutive GC/expansion failures? */
+ /* Reset by GC_allochblk(); defined in alloc.c. */
+
+GC_EXTERN long GC_large_alloc_warn_interval; /* defined in misc.c */
+
+GC_EXTERN signed_word GC_bytes_found;
+ /* Number of reclaimed bytes after garbage collection; */
+ /* protected by GC lock; defined in reclaim.c. */
+
+#ifdef USE_MUNMAP
+ GC_EXTERN int GC_unmap_threshold; /* defined in allchblk.c */
+ GC_EXTERN GC_bool GC_force_unmap_on_gcollect; /* defined in misc.c */
+#endif
+
+#ifdef MSWIN32
+ GC_EXTERN GC_bool GC_no_win32_dlls; /* defined in os_dep.c */
+ GC_EXTERN GC_bool GC_wnt; /* Is Windows NT derivative; */
+ /* defined and set in os_dep.c. */
+#endif
+
+#ifdef THREADS
+ GC_EXTERN long GC_markers; /* Number of mark threads we would like */
+ /* to have. Includes the initiating */
+ /* thread. Defined in mark.c. */
+# if defined(MSWIN32) || defined(MSWINCE)
+ GC_EXTERN CRITICAL_SECTION GC_write_cs; /* defined in misc.c */
+# endif
+# ifdef MPROTECT_VDB
+ GC_EXTERN volatile AO_TS_t GC_fault_handler_lock;
+ /* defined in os_dep.c */
+# endif
+# ifdef MSWINCE
+ GC_EXTERN GC_bool GC_dont_query_stack_min;
+ /* Defined and set in os_dep.c. */
+# endif
+#elif defined(IA64)
+ GC_EXTERN ptr_t GC_save_regs_ret_val; /* defined in mach_dep.c. */
+ /* Previously set to backing store pointer. */
+#endif /* !THREADS */
+
+#ifdef THREAD_LOCAL_ALLOC
+ GC_EXTERN GC_bool GC_world_stopped; /* defined in alloc.c */
+#endif
+
+#ifdef GC_GCJ_SUPPORT
+ GC_EXTERN GC_bool GC_gcj_malloc_initialized; /* defined in gcj_mlc.c */
+ GC_EXTERN ptr_t * GC_gcjobjfreelist;
+#endif
# ifdef GC_ASSERTIONS
# define GC_ASSERT(expr) if(!(expr)) {\
void GC_notify_all_builder(void);
void GC_wait_for_reclaim(void);
- extern word GC_fl_builder_count; /* Protected by mark lock. */
+ GC_EXTERN word GC_fl_builder_count; /* Protected by mark lock. */
void GC_notify_all_marker(void);
void GC_wait_marker(void);
- extern word GC_mark_no; /* Protected by mark lock. */
+ GC_EXTERN word GC_mark_no; /* Protected by mark lock. */
void GC_help_marker(word my_mark_no);
/* Try to help out parallel marker for mark cycle */
} * GC_thread;
# define THREAD_TABLE_SZ 256 /* Must be power of 2 */
-extern volatile GC_thread GC_threads[THREAD_TABLE_SZ];
+GC_EXTERN volatile GC_thread GC_threads[THREAD_TABLE_SZ];
-extern GC_bool GC_thr_initialized;
+GC_EXTERN GC_bool GC_thr_initialized;
GC_thread GC_lookup_thread(pthread_t id);
void GC_stop_init(void);
-extern GC_bool GC_in_thread_creation;
+GC_EXTERN GC_bool GC_in_thread_creation;
/* We may currently be in thread creation or destruction. */
/* Only set to TRUE while allocation lock is held. */
/* When set, it is OK to run GC from unknown thread. */
#if defined(THREADS)
-extern signed_word GC_bytes_found;
- /* protected by GC lock; defined in reclaim.c. */
-
-#ifdef PARALLEL_MARK
-volatile signed_word GC_bytes_allocd_tmp = 0;
+# ifdef PARALLEL_MARK
+ STATIC volatile signed_word GC_bytes_allocd_tmp = 0;
/* Number of bytes of memory allocated since */
/* we released the GC lock. Instead of */
/* reacquiring the GC lock just to add this in, */
/* the lock. (Atomically adding it doesn't */
/* work, since we would have to atomically */
/* update it in GC_malloc, which is too */
- /* expensive.) */
-#endif /* PARALLEL_MARK */
+ /* expensive.) */
+# endif /* PARALLEL_MARK */
/* Return a list of 1 or more objects of the indicated size, linked */
/* through the first word in the object. This has the advantage that */
# endif
}
-# ifdef IA64
- extern ptr_t GC_save_regs_ret_val; /* defined in mach_dep.c. */
- /* Previously set to backing store pointer. */
-# endif
-
#endif /* !THREADS */
/* Push enough of the current stack eagerly to */
GC_with_callee_saves_pushed(GC_push_current_stack, cold_gc_frame);
}
-#ifdef THREAD_LOCAL_ALLOC
- extern GC_bool GC_world_stopped; /* defined in alloc.c */
-#endif
-
/*
* Call the mark routines (GC_tl_push for a single pointer, GC_push_conditional
* on groups of pointers) on every top level accessible pointer.
GC_bool GC_dont_precollect = 0;
-GC_bool GC_quiet = 0;
+GC_bool GC_quiet = 0; /* used also in pcr_interface.c */
#ifndef SMALL_CONFIG
GC_bool GC_print_stats = 0;
void GC_thr_init(void);
#endif
-#ifdef USE_MUNMAP
- extern int GC_unmap_threshold; /* defined in allchblk.c */
-#endif
-
#ifdef LINT
int GC_read(void);
void GC_register_finalizer_no_order(void);
GC_bool GC_wnt = FALSE;
/* This is a Windows NT derivative, i.e. NT, W2K, XP or later. */
-# ifdef USE_MUNMAP
- extern int GC_unmap_threshold; /* defined in allchblk.c */
-# endif
-
void GC_init_win32(void)
{
/* Set GC_wnt. */
}
}
-extern long GC_markers; /* Number of mark threads we would like to */
- /* have. Includes the initiating thread. */
- /* Defined in mark.c. */
-
STATIC pthread_t GC_mark_threads[MAX_MARKERS];
#define PTHREAD_CREATE REAL_FUNC(pthread_create)
GC_bool GC_thr_initialized = FALSE;
-volatile GC_thread GC_threads[THREAD_TABLE_SZ];
+volatile GC_thread GC_threads[THREAD_TABLE_SZ] = {0};
void GC_push_thread_structures(void)
{
volatile AO_TS_t GC_allocate_lock = 0;
-
void GC_lock(void)
{
# define low_spin_max 30 /* spin cycles if we suspect uniprocessor */
# endif
}
-#ifdef GC_GCJ_SUPPORT
- extern ptr_t * GC_gcjobjfreelist; /* defined in gcj_mlc.c. */
-#endif
-
/* We hold the allocator lock. */
void GC_destroy_thread_local(GC_tlfs p)
{
#include "include/gc_gcj.h"
-#ifdef GC_ASSERTIONS
- extern GC_bool GC_gcj_malloc_initialized; /* defined in gcj_mlc.c. */
-#endif
-
-extern int GC_gcj_kind; /* defined in gcj_mlc.c. */
-
/* Gcj-style allocation without locks is extremely tricky. The */
/* fundamental issue is that we may end up marking a free list, which */
/* has freelist links instead of "vtable" pointers. That is usually */
#if defined(MPROTECT_VDB)
# include "atomic_ops.h"
- extern volatile AO_TS_t GC_fault_handler_lock; /* defined in os_dep.c */
#endif
/* Suspend the given thread, if it's still active. */
# endif
}
-#ifndef CYGWIN32
- extern CRITICAL_SECTION GC_write_cs; /* defined in misc.c */
-#endif
-
void GC_stop_world(void)
{
DWORD thread_id = GetCurrentThreadId();
}
#ifdef MSWINCE
- extern GC_bool GC_dont_query_stack_min;
- /* Defined and set in os_dep.c. */
-
/* The VirtualQuery calls below won't work properly on some old WinCE */
/* versions, but since each stack is restricted to an aligned 64 KiB */
/* region of virtual memory we can just take the next lowest multiple */
# define MAX_MARKERS 16
# endif
- extern long GC_markers;
- /* Number of mark threads we would like to */
- /* have. Includes the initiating thread. */
- /* Defined in mark.c. */
-
static ptr_t marker_sp[MAX_MARKERS - 1]; /* The cold end of the stack */
/* for markers. */
# ifdef IA64
# endif /* !DONT_USE_SIGNALANDWAIT */
-# ifndef MSWINCE
- extern GC_bool GC_wnt; /* defined in os_dep.c */
-# endif
-
# endif /* ! GC_PTHREADS_PARAMARK */
#endif /* PARALLEL_MARK */