/* Number of mark stack entries to discard on overflow. */
#define GC_MARK_STACK_DISCARDS (INITIAL_MARK_STACK_SIZE/8)
-typedef struct GC_ms_entry {
- ptr_t mse_start; /* First word of object, word aligned. */
- GC_word mse_descr; /* Descriptor; low order two bits are tags, */
- /* as described in gc_mark.h. */
-} mse;
-
GC_EXTERN size_t GC_mark_stack_size;
-GC_EXTERN mse * GC_mark_stack_limit;
-
-#ifdef PARALLEL_MARK
- GC_EXTERN mse * volatile GC_mark_stack_top;
-#else
- GC_EXTERN mse * GC_mark_stack_top;
-#endif
-
-GC_EXTERN mse * GC_mark_stack;
-
#ifdef PARALLEL_MARK
/*
* Allow multiple threads to participate in the marking process.
# endif
#endif /* !MAX_HEAP_SECTS */
+typedef struct GC_ms_entry {
+ ptr_t mse_start; /* First word of object, word aligned. */
+ word mse_descr; /* Descriptor; low order two bits are tags, */
+ /* as described in gc_mark.h. */
+} mse;
+
/* Lists of all heap blocks and free lists */
/* as well as other random data structures */
/* that should not be scanned by the */
ptr_t _scratch_last_end_ptr;
/* Used by headers.c, and can easily appear to point to */
/* heap. */
+ mse *_mark_stack;
+ /* Limits of stack for GC_mark routine. All ranges */
+ /* between GC_mark_stack (incl.) and GC_mark_stack_top */
+ /* (incl.) still need to be marked from. */
+ mse *_mark_stack_limit;
+# ifdef PARALLEL_MARK
+ mse *volatile _mark_stack_top;
+ /* Updated only with mark lock held, but read asynchronously. */
+# else
+ mse *_mark_stack_top;
+# endif
GC_mark_proc _mark_procs[MAX_MARK_PROCS];
/* Table of user-defined mark procedures. There is */
/* a small number of these, which can be referenced */
#define GC_large_allocd_bytes GC_arrays._large_allocd_bytes
#define GC_large_free_bytes GC_arrays._large_free_bytes
#define GC_last_heap_addr GC_arrays._last_heap_addr
+#define GC_mark_stack GC_arrays._mark_stack
+#define GC_mark_stack_limit GC_arrays._mark_stack_limit
+#define GC_mark_stack_top GC_arrays._mark_stack_top
#define GC_mark_procs GC_arrays._mark_procs
#define GC_max_heapsize GC_arrays._max_heapsize
#define GC_max_large_allocd_bytes GC_arrays._max_large_allocd_bytes
/* grow dynamically. */
# endif
-/*
- * Limits of stack for GC_mark routine.
- * All ranges between GC_mark_stack(incl.) and GC_mark_stack_top(incl.) still
- * need to be marked from.
- */
-
STATIC word GC_n_rescuing_pages = 0;
/* Number of dirty pages we marked from */
/* excludes ptrfree pages, etc. */
-GC_INNER mse * GC_mark_stack = NULL;
-GC_INNER mse * GC_mark_stack_limit = NULL;
GC_INNER size_t GC_mark_stack_size = 0;
#ifdef PARALLEL_MARK
- GC_INNER mse * volatile GC_mark_stack_top = NULL;
- /* 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. */
/* Updated only by initiating */
/* thread. */
-#else
- GC_INNER mse * GC_mark_stack_top = NULL;
#endif
GC_INNER mark_state_t GC_mark_state = MS_NONE;
ptr_t least_ha = GC_least_plausible_heap_addr;
mse * mark_stack_top = GC_mark_stack_top;
mse * mark_stack_limit = GC_mark_stack_limit;
+
+# undef GC_mark_stack_top
+# undef GC_mark_stack_limit
# define GC_mark_stack_top mark_stack_top
# define GC_mark_stack_limit mark_stack_limit
# define GC_greatest_plausible_heap_addr greatest_ha
# undef GC_least_plausible_heap_addr
# undef GC_mark_stack_top
# undef GC_mark_stack_limit
-
+# define GC_mark_stack_limit GC_arrays._mark_stack_limit
+# define GC_mark_stack_top GC_arrays._mark_stack_top
GC_mark_stack_top = mark_stack_top;
}
mse * mark_stack_top = GC_mark_stack_top;
mse * mark_stack_limit = GC_mark_stack_limit;
+# undef GC_mark_stack_top
+# undef GC_mark_stack_limit
# define GC_mark_stack_top mark_stack_top
# define GC_mark_stack_limit mark_stack_limit
# define GC_greatest_plausible_heap_addr greatest_ha
# undef GC_least_plausible_heap_addr
# undef GC_mark_stack_top
# undef GC_mark_stack_limit
-
+# define GC_mark_stack_limit GC_arrays._mark_stack_limit
+# define GC_mark_stack_top GC_arrays._mark_stack_top
GC_mark_stack_top = mark_stack_top;
}
ptr_t least_ha = GC_least_plausible_heap_addr;
mse * mark_stack_top = GC_mark_stack_top;
mse * mark_stack_limit = GC_mark_stack_limit;
+
+# undef GC_mark_stack_top
+# undef GC_mark_stack_limit
# define GC_mark_stack_top mark_stack_top
# define GC_mark_stack_limit mark_stack_limit
# define GC_greatest_plausible_heap_addr greatest_ha
# undef GC_least_plausible_heap_addr
# undef GC_mark_stack_top
# undef GC_mark_stack_limit
+# define GC_mark_stack_limit GC_arrays._mark_stack_limit
+# define GC_mark_stack_top GC_arrays._mark_stack_top
GC_mark_stack_top = mark_stack_top;
}