/* */
/*********************************/
-#ifdef SAVE_CALL_CHAIN
-
-/* Fill in the pc and argument information for up to NFRAMES of my */
-/* callers. Ignore my frame and my callers frame. */
-struct callinfo;
-void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
-
-void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
-
-#endif
-
#ifdef NEED_CALLINFO
struct callinfo {
word ci_pc; /* Caller, not callee, pc */
};
#endif
+#ifdef SAVE_CALL_CHAIN
+
+/* Fill in the pc and argument information for up to NFRAMES of my */
+/* callers. Ignore my frame and my callers frame. */
+void GC_save_callers GC_PROTO((struct callinfo info[NFRAMES]));
+
+void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
+
+#endif
+
/*********************************/
/* */
# define BZERO(x,n) bzero((char *)(x),(int)(n))
# endif
+#if defined(DARWIN)
+# if defined(POWERPC)
+# define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
+# elif defined(I386)
+# define GC_MACH_THREAD_STATE_FLAVOR i386_THREAD_STATE
+# elif defined(X86_64)
+# define GC_MACH_THREAD_STATE_FLAVOR x86_THREAD_STATE64
+# else
+# define GC_MACH_THREAD_STATE_FLAVOR MACHINE_THREAD_STATE
+# endif
+#endif
+
/* Delay any interrupts or signals that may abort this thread. Data */
/* structures are in a consistent state outside this pair of calls. */
/* ANSI C allows both to be empty (though the standard isn't very */
# define ENABLE_SIGNALS()
# else
# define DISABLE_SIGNALS() GC_disable_signals()
- void GC_disable_signals();
+ void GC_disable_signals(void);
# define ENABLE_SIGNALS() GC_enable_signals()
- void GC_enable_signals();
+ void GC_enable_signals(void);
# endif
# endif
# else
# if defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) \
|| defined(GC_PTHREADS)
- void GC_stop_world();
- void GC_start_world();
+ void GC_stop_world(void);
+ void GC_start_world(void);
# define STOP_WORLD() GC_stop_world()
# define START_WORLD() GC_start_world()
# else
#define CPP_MAXOBJBYTES (CPP_HBLKSIZE/2)
#define MAXOBJBYTES ((word)CPP_MAXOBJBYTES)
-#define CPP_MAXOBJSZ BYTES_TO_WORDS(CPP_HBLKSIZE/2)
+#define CPP_MAXOBJSZ BYTES_TO_WORDS(CPP_MAXOBJBYTES)
#define MAXOBJSZ ((word)CPP_MAXOBJSZ)
# define divHBLKSZ(n) ((n) >> LOG_HBLKSIZE)
# define MAP_SIZE MAP_ENTRIES
# define CPP_MAX_OFFSET (OFFSET_TOO_BIG - 1)
# define MAX_OFFSET ((word)CPP_MAX_OFFSET)
+# define INIT_MAP(map) memset((map), OBJ_INVALID, MAP_SIZE)
/* The following are used only if GC_all_interior_ptrs != 0 */
# define VALID_OFFSET_SZ \
(CPP_MAX_OFFSET > WORDS_TO_BYTES(CPP_MAXOBJSZ)? \
char _valid_offsets[VALID_OFFSET_SZ];
/* GC_valid_offsets[i] == TRUE ==> i */
/* is registered as a displacement. */
-# define OFFSET_VALID(displ) \
- (GC_all_interior_pointers || GC_valid_offsets[displ])
char _modws_valid_offsets[sizeof(word)];
/* GC_valid_offsets[i] ==> */
/* GC_modws_valid_offsets[i%sizeof(word)] */
+# define OFFSET_VALID(displ) \
+ (GC_all_interior_pointers || GC_valid_offsets[displ])
# ifdef STUBBORN_ALLOC
page_hash_table _changed_pages;
/* Stubborn object pages that were changes since last call to */
# ifdef SMALL_CONFIG
# define MAX_HEAP_SECTS 128 /* Roughly 256MB (128*2048*1K) */
# else
-# define MAX_HEAP_SECTS 384 /* Roughly 3GB */
+# define MAX_HEAP_SECTS (384+128) /* Roughly 4GB */
# endif
# endif
struct HeapSect {
/* are ignored. */
ptr_t GC_generic_malloc_inner GC_PROTO((word lb, int k));
/* Ditto, but I already hold lock, etc. */
+ptr_t GC_generic_malloc_words_small_inner GC_PROTO((word lw, int k));
+ /* Analogous to the above, but assumes */
+ /* a small object size, and bypasses */
+ /* MERGE_SIZES mechanism. */
ptr_t GC_generic_malloc_words_small GC_PROTO((size_t lw, int k));
/* As above, but size in units of words */
/* Bypasses MERGE_SIZES. Assumes */
#ifdef KEEP_BACK_PTRS
extern long GC_backtraces;
+ void GC_generate_random_backtrace_no_gc(void);
+#endif
+
+extern GC_bool GC_print_back_height;
+
+#ifdef MAKE_BACK_GRAPH
+ void GC_print_back_graph_stats(void);
#endif
/* Macros used for collector internal allocation. */
# ifdef __DMC__
GC_API void GC_noop(...);
# else
- GC_API void GC_noop();
+ GC_API void GC_noop(void*,...);
# endif
# endif
/* GC_notify_all_builder() is called when GC_fl_builder_count */
/* reaches 0. */
- extern void GC_acquire_mark_lock();
- extern void GC_release_mark_lock();
- extern void GC_notify_all_builder();
+ extern void GC_acquire_mark_lock(void);
+ extern void GC_release_mark_lock(void);
+ extern void GC_notify_all_builder(void);
/* extern void GC_wait_builder(); */
- extern void GC_wait_for_reclaim();
+ extern void GC_wait_for_reclaim(void);
extern word GC_fl_builder_count; /* Protected by mark lock. */
# endif /* PARALLEL_MARK || THREAD_LOCAL_ALLOC */
# ifdef PARALLEL_MARK
- extern void GC_notify_all_marker();
- extern void GC_wait_marker();
+ extern void GC_notify_all_marker(void);
+ extern void GC_wait_marker(void);
extern word GC_mark_no; /* Protected by mark lock. */
extern void GC_help_marker(word my_mark_no);
/* in Linux glibc, but it's not exported.) Thus we continue to use */
/* the same hard-coded signals we've always used. */
# if !defined(SIG_SUSPEND)
-# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
+# if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS) || defined(GC_NETBSD_THREADS)
# if defined(SPARC) && !defined(SIGPWR)
/* SPARC/Linux doesn't properly define SIGPWR in <signal.h>.
* It is aliased to SIGLOST in asm/signal.h, though. */
# define SIG_SUSPEND SIGLOST
+# elif defined(NACL)
+# define SIG_SUSPEND 0
# else
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */
# define SIG_SUSPEND SIGPWR