diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | include/private/gc_priv.h | 9 | ||||
-rw-r--r-- | mark.c | 21 | ||||
-rw-r--r-- | win32_threads.c | 8 |
4 files changed, 31 insertions, 21 deletions
@@ -1,5 +1,19 @@ 2009-10-19 Ivan Maidanski <ivmai@mail.ru> + * include/private/gc_priv.h (GC_bytes_allocd, GC_objfreelist, + GC_aobjfreelist): Replace GC_EXTERN to extern for SEPARATE_GLOBALS + case (since they are not defined inside GC at present). + * include/private/gc_priv.h (GC_objects_are_marked): Remove the + declaration (since made static). + * mark.c (GC_objects_are_marked): Define as STATIC. + * win32_threads.c (GC_thr_initialized, GC_in_thread_creation): + Ditto. + * mark.c (GC_N_KINDS_INITIAL_VALUE): New macro (defined and used + to initialize GC_n_kinds). + * win32_threads.c (start_mark_threads): Adjust the comment. + +2009-10-19 Ivan Maidanski <ivmai@mail.ru> + * alloc.c (GC_notify_full_gc): Use GC_INLINE for a tiny static function. * backgraph.c (pop_in_progress, GC_apply_to_each_object): Ditto. diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 5ca40aea..18143e4f 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1227,14 +1227,14 @@ GC_EXTERN struct obj_kind { /* introduce maintenance problems. */ #ifdef SEPARATE_GLOBALS - GC_EXTERN word GC_bytes_allocd; + extern word GC_bytes_allocd; /* Number of words allocated during this collection cycle */ - GC_EXTERN ptr_t GC_objfreelist[MAXOBJGRANULES+1]; + 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)) - GC_EXTERN ptr_t GC_aobjfreelist[MAXOBJGRANULES+1]; + 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)) @@ -1277,9 +1277,6 @@ GC_EXTERN word GC_black_list_spacing; /* "stack-blacklisted", i.e. that are */ /* problematic in the interior of an object. */ -GC_EXTERN GC_bool GC_objects_are_marked; /* There are marked objects in */ - /* the heap. */ - #ifndef SMALL_CONFIG GC_EXTERN GC_bool GC_incremental; /* Using incremental/generational collection. */ @@ -72,18 +72,19 @@ struct obj_kind GC_obj_kinds[MAXOBJKINDS] = { # ifdef ATOMIC_UNCOLLECTABLE # ifdef STUBBORN_ALLOC - unsigned GC_n_kinds = 5; +# define GC_N_KINDS_INITIAL_VALUE 5 # else - unsigned GC_n_kinds = 4; +# define GC_N_KINDS_INITIAL_VALUE 4 # endif # else # ifdef STUBBORN_ALLOC - unsigned GC_n_kinds = 4; +# define GC_N_KINDS_INITIAL_VALUE 4 # else - unsigned GC_n_kinds = 3; +# define GC_N_KINDS_INITIAL_VALUE 3 # endif # endif +unsigned GC_n_kinds = GC_N_KINDS_INITIAL_VALUE; # ifndef INITIAL_MARK_STACK_SIZE # define INITIAL_MARK_STACK_SIZE (1*HBLKSIZE) @@ -106,14 +107,12 @@ STATIC word GC_n_rescuing_pages = 0; /* excludes ptrfree pages, etc. */ mse * GC_mark_stack = NULL; - mse * GC_mark_stack_limit = NULL; - size_t GC_mark_stack_size = 0; #ifdef PARALLEL_MARK mse * volatile GC_mark_stack_top = NULL; - /* Updated only with mark lock held, but read asynchronously. */ + /* Updated only with mark lock held, but read asynchronously. */ STATIC volatile AO_t GC_first_nonempty = 0; /* Lowest entry on mark stack */ /* that may be nonempty. */ @@ -123,14 +122,14 @@ size_t GC_mark_stack_size = 0; mse * GC_mark_stack_top = NULL; #endif -static struct hblk * scan_ptr; - mark_state_t GC_mark_state = MS_NONE; GC_bool GC_mark_stack_too_small = FALSE; -GC_bool GC_objects_are_marked = FALSE; /* Are there collectable marked */ - /* objects in the heap? */ +static struct hblk * scan_ptr; + +STATIC GC_bool GC_objects_are_marked = FALSE; + /* Are there collectable marked objects in the heap? */ /* Is a collection in progress? Note that this can return true in the */ /* nonincremental case, if a collection has been abandoned and the */ diff --git a/win32_threads.c b/win32_threads.c index 49dc4e99..1ca9d326 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -149,7 +149,7 @@ /* this better. */ typedef LONG * IE_t; -GC_bool GC_thr_initialized = FALSE; +STATIC GC_bool GC_thr_initialized = FALSE; GC_bool GC_need_to_lock = FALSE; @@ -359,7 +359,8 @@ LONG WINAPI GC_write_fault_handler(struct _EXCEPTION_POINTERS *exc_info); /* may be called repeatedly. */ #endif -GC_bool GC_in_thread_creation = FALSE; /* Protected by allocation lock. */ +STATIC GC_bool GC_in_thread_creation = FALSE; + /* Protected by allocation lock. */ /* * This may be called from DllMain, and hence operates under unusual @@ -1487,8 +1488,7 @@ void GC_get_next_stack(char *start, char *limit, /* start_mark_threads() is the same as in pthread_support.c except for: */ /* - GC_markers value is adjusted already; */ /* - thread stack is assumed to be large enough; and */ - /* - statistics about the number of marker threads is already printed. */ - + /* - statistics about the number of marker threads is printed outside. */ static void start_mark_threads(void) { int i; |