27 # error Why is the BoehmGC header included???
46 #define GCCONF_FINALIZER
55 #if !defined(NDEBUG) && defined(GC_DEBUGGING)
58 # define GC_LOG(code) if (opt_verbosegc) { code; }
59 # define GC_ASSERT(assertion) assert(assertion)
62 # define GC_ASSERT(assertion)
65 #if !defined(NDEBUG) && defined(GC_DEBUGGING2)
66 # define GC_LOG2(code) GC_LOG(code)
68 # define GC_LOG2(code)
74 #if 0 && defined(ENABLE_THREADS)
75 # error "GC does not work with threads enabled!"
78 #if 1 && defined(ENABLE_INTRP)
79 # error "GC does not work with interpreter enabled!"
82 #if 1 && defined(ENABLE_JVMTI)
83 # error "GC does not work with JVMTI enabled!"
86 #if 1 && !defined(ENABLE_REPLACEMENT)
87 # error "GC does only work with replacement enabled!"
90 #if 1 && !defined(ENABLE_HANDLES)
91 # error "GC does only work with handles (indirection cells) enabled!"
94 #if 1 && !defined(__ALPHA__) && !defined(__ARM__) && !defined(__I386__) && !defined(__POWERPC__) && !defined(__X86_64__) && !defined(__SPARC_64__)
95 # error "GC was only ported to some architectures so far!"
101 #define GC_SET_FLAGS(obj, flags) ((obj)->hdrflags |= (flags))
102 #define GC_CLEAR_FLAGS(obj, flags) ((obj)->hdrflags &= ~(flags))
103 #define GC_TEST_FLAGS(obj, flags) ((obj)->hdrflags & (flags))
105 #define POINTS_INTO(ptr, ptr_start, ptr_end) \
106 ((void *) (ptr) >= (ptr_start) && (void *) (ptr) < (ptr_end))
108 #define GC_ALIGN_SIZE SIZEOF_VOID_P
109 #define GC_ALIGN(val,size) ((((val) + (size) - 1) / (size)) * (size))
136 #if defined(ENABLE_THREADS)
137 # define GC_MUTEX_LOCK threads_mutex_gc_lock()
138 # define GC_MUTEX_UNLOCK threads_mutex_gc_unlock()
140 # define GC_MUTEX_LOCK
141 # define GC_MUTEX_UNLOCK
147 #if defined(ENABLE_THREADS)
148 # define GC_EXECUTIONSTATE (thread->es)
149 # define GC_SOURCESTATE (thread->ss)
151 # define GC_EXECUTIONSTATE (_no_threads_executionstate)
152 # define GC_SOURCESTATE (_no_threads_sourcestate)
155 extern sourcestate_t *_no_threads_sourcestate;
164 #if defined(ENABLE_THREADS)
171 #if defined(ENABLE_STATISTICS)
173 #define GCSTAT_INIT(cnt) { (cnt) = 0; }
174 #define GCSTAT_COUNT(cnt) { (cnt)++; }
175 #define GCSTAT_DEC(cnt) { (cnt)--; GC_ASSERT((cnt) >= 0); }
176 #define GCSTAT_COUNT_MAX(cnt,max) { (cnt)++; if ((cnt) > (max)) (max) = (cnt); }
178 extern int gcstat_collections;
179 extern int gcstat_collections_forced;
180 extern int gcstat_mark_depth;
181 extern int gcstat_mark_depth_max;
182 extern int gcstat_mark_count;
184 void gcstat_println();
188 #define GCSTAT_INIT(cnt)
189 #define GCSTAT_COUNT(cnt)
190 #define GCSTAT_DEC(cnt)
191 #define GCSTAT_COUNT_MAX(cnt,max)
void gc_collect(s4 level)
bool gc_suspend(threadobject *thread, u1 *pc, u1 *sp)
list_t * gc_reflist_strong