summaryrefslogtreecommitdiff
path: root/boehm-gc/gc_mark.h
diff options
context:
space:
mode:
Diffstat (limited to 'boehm-gc/gc_mark.h')
-rw-r--r--boehm-gc/gc_mark.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/boehm-gc/gc_mark.h b/boehm-gc/gc_mark.h
index ade98a91857..4628323f990 100644
--- a/boehm-gc/gc_mark.h
+++ b/boehm-gc/gc_mark.h
@@ -38,12 +38,17 @@
/* subset of the places the conservative marker would. It must be safe */
/* to invoke the normal mark procedure instead. */
# define PROC_BYTES 100
-typedef struct ms_entry * (*mark_proc)(/* word * addr, mark_stack_ptr,
- mark_stack_limit, env */);
+/* The real declarations of the following are in gc_priv.h, so that */
+/* we can avoid scanning the following table. */
+/*
+typedef struct ms_entry * (*mark_proc)( word * addr, mark_stack_ptr,
+ mark_stack_limit, env );
# define LOG_MAX_MARK_PROCS 6
# define MAX_MARK_PROCS (1 << LOG_MAX_MARK_PROCS)
extern mark_proc GC_mark_procs[MAX_MARK_PROCS];
+*/
+
extern word GC_n_mark_procs;
/* Object descriptors on mark stack or in objects. Low order two */
@@ -166,6 +171,8 @@ mse * GC_signal_mark_stack_overflow();
/* Mark bit is already set */ \
goto exit_label; \
} \
+ GC_STORE_BACK_PTR((ptr_t)source, (ptr_t)HBLKPTR(current) \
+ + WORDS_TO_BYTES(displ)); \
*mark_word_addr = mark_word | mark_bit; \
} \
PUSH_OBJ(((word *)(HBLKPTR(current)) + displ), hhdr, \
@@ -173,18 +180,24 @@ mse * GC_signal_mark_stack_overflow();
exit_label: ; \
}
+#ifdef PRINT_BLACK_LIST
+# define PUSH_ONE_CHECKED(p, ip, source) \
+ GC_push_one_checked(p, ip, (ptr_t)(source))
+#else
+# define PUSH_ONE_CHECKED(p, ip, source) \
+ GC_push_one_checked(p, ip)
+#endif
/*
* Push a single value onto mark stack. Mark from the object pointed to by p.
- * GC_push_one is normally called by GC_push_regs, and thus must be defined.
* P is considered valid even if it is an interior pointer.
* Previously marked objects are not pushed. Hence we make progress even
* if the mark stack overflows.
*/
-# define GC_PUSH_ONE_STACK(p) \
+# define GC_PUSH_ONE_STACK(p, source) \
if ((ptr_t)(p) >= GC_least_plausible_heap_addr \
&& (ptr_t)(p) < GC_greatest_plausible_heap_addr) { \
- GC_push_one_checked(p,TRUE); \
+ PUSH_ONE_CHECKED(p, TRUE, source); \
}
/*
@@ -196,10 +209,10 @@ mse * GC_signal_mark_stack_overflow();
# else
# define AIP FALSE
# endif
-# define GC_PUSH_ONE_HEAP(p) \
+# define GC_PUSH_ONE_HEAP(p,source) \
if ((ptr_t)(p) >= GC_least_plausible_heap_addr \
&& (ptr_t)(p) < GC_greatest_plausible_heap_addr) { \
- GC_push_one_checked(p,AIP); \
+ PUSH_ONE_CHECKED(p,AIP,source); \
}
/*
@@ -213,7 +226,7 @@ mse * GC_signal_mark_stack_overflow();
while (!GC_mark_stack_empty()) GC_mark_from_mark_stack(); \
if (GC_mark_state != MS_NONE) { \
GC_set_mark_bit(real_ptr); \
- while (!GC_mark_some()); \
+ while (!GC_mark_some((ptr_t)0)); \
} \
}
@@ -233,8 +246,8 @@ typedef int mark_state_t; /* Current state of marking, as follows:*/
/* Invariant I: all roots and marked */
/* objects p are either dirty, or point */
- /* objects q that are either marked or */
- /* a pointer to q appears in a range */
+ /* to objects q that are either marked */
+ /* or a pointer to q appears in a range */
/* on the mark stack. */
# define MS_NONE 0 /* No marking in progress. I holds. */