version 1.3, 2001/04/20 07:39:26 |
version 1.5, 2002/07/24 08:00:20 |
|
|
# define BSD_TIME |
# define BSD_TIME |
#endif |
#endif |
|
|
|
#ifdef DGUX |
|
# include <sys/types.h> |
|
# include <sys/time.h> |
|
# include <sys/resource.h> |
|
#endif /* DGUX */ |
|
|
#ifdef BSD_TIME |
#ifdef BSD_TIME |
# include <sys/types.h> |
# include <sys/types.h> |
# include <sys/time.h> |
# include <sys/time.h> |
|
|
# include "../gc_mark.h" |
# include "../gc_mark.h" |
# endif |
# endif |
|
|
# ifndef GCCONFIG_H |
|
# include "gcconfig.h" |
|
# endif |
|
|
|
typedef GC_word word; |
typedef GC_word word; |
typedef GC_signed_word signed_word; |
typedef GC_signed_word signed_word; |
|
|
Line 60 typedef char * ptr_t; /* A generic pointer to which we |
|
Line 62 typedef char * ptr_t; /* A generic pointer to which we |
|
/* Preferably identical to caddr_t, if it */ |
/* Preferably identical to caddr_t, if it */ |
/* exists. */ |
/* exists. */ |
|
|
|
# ifndef GCCONFIG_H |
|
# include "gcconfig.h" |
|
# endif |
|
|
# ifndef HEADERS_H |
# ifndef HEADERS_H |
# include "gc_hdrs.h" |
# include "gc_hdrs.h" |
# endif |
# endif |
Line 205 typedef char * ptr_t; /* A generic pointer to which we |
|
Line 211 typedef char * ptr_t; /* A generic pointer to which we |
|
/* odd numbered words to have mark bits. */ |
/* odd numbered words to have mark bits. */ |
#endif |
#endif |
|
|
|
#if defined(GC_GCJ_SUPPORT) && ALIGNMENT < 8 && !defined(ALIGN_DOUBLE) |
|
/* GCJ's Hashtable synchronization code requires 64-bit alignment. */ |
|
# define ALIGN_DOUBLE |
|
#endif |
|
|
/* ALIGN_DOUBLE requires MERGE_SIZES at present. */ |
/* ALIGN_DOUBLE requires MERGE_SIZES at present. */ |
# if defined(ALIGN_DOUBLE) && !defined(MERGE_SIZES) |
# if defined(ALIGN_DOUBLE) && !defined(MERGE_SIZES) |
# define MERGE_SIZES |
# define MERGE_SIZES |
Line 249 typedef char * ptr_t; /* A generic pointer to which we |
|
Line 260 typedef char * ptr_t; /* A generic pointer to which we |
|
|
|
#ifdef SAVE_CALL_CHAIN |
#ifdef SAVE_CALL_CHAIN |
|
|
/* |
|
* Number of frames and arguments to save in objects allocated by |
|
* debugging allocator. |
|
*/ |
|
# ifndef SAVE_CALL_COUNT |
|
# define NFRAMES 6 /* Number of frames to save. Even for */ |
|
/* alignment reasons. */ |
|
# else |
|
# define NFRAMES ((SAVE_CALL_COUNT + 1) & ~1) |
|
# endif |
|
# define NARGS 2 /* Mumber of arguments to save for each call. */ |
|
|
|
# define NEED_CALLINFO |
|
|
|
/* Fill in the pc and argument information for up to NFRAMES of my */ |
/* Fill in the pc and argument information for up to NFRAMES of my */ |
/* callers. Ignore my frame and my callers frame. */ |
/* callers. Ignore my frame and my callers frame. */ |
struct callinfo; |
struct callinfo; |
Line 270 void GC_save_callers GC_PROTO((struct callinfo info[NF |
|
Line 267 void GC_save_callers GC_PROTO((struct callinfo info[NF |
|
|
|
void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); |
void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); |
|
|
#else |
|
|
|
# ifdef GC_ADD_CALLER |
|
# define NFRAMES 1 |
|
# define NARGS 0 |
|
# define NEED_CALLINFO |
|
# endif |
|
|
|
#endif |
#endif |
|
|
#ifdef NEED_CALLINFO |
#ifdef NEED_CALLINFO |
Line 376 void GC_print_callers GC_PROTO((struct callinfo info[N |
|
Line 365 void GC_print_callers GC_PROTO((struct callinfo info[N |
|
# define BZERO(x,n) bzero((char *)(x),(int)(n)) |
# define BZERO(x,n) bzero((char *)(x),(int)(n)) |
# endif |
# endif |
|
|
/* HBLKSIZE aligned allocation. 0 is taken to mean failure */ |
|
/* space is assumed to be cleared. */ |
|
/* In the case os USE_MMAP, the argument must also be a */ |
|
/* physical page size. */ |
|
/* GET_MEM is currently not assumed to retrieve 0 filled space, */ |
|
/* though we should perhaps take advantage of the case in which */ |
|
/* does. */ |
|
struct hblk; /* See below. */ |
|
# ifdef PCR |
|
char * real_malloc(); |
|
# define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \ |
|
+ GC_page_size-1) |
|
# else |
|
# ifdef OS2 |
|
void * os2_alloc(size_t bytes); |
|
# define GET_MEM(bytes) HBLKPTR((ptr_t)os2_alloc((size_t)bytes \ |
|
+ GC_page_size) \ |
|
+ GC_page_size-1) |
|
# else |
|
# if defined(NEXT) || defined(MACOSX) || defined(DOS4GW) || \ |
|
(defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) |
|
# define GET_MEM(bytes) HBLKPTR((size_t) \ |
|
calloc(1, (size_t)bytes + GC_page_size) \ |
|
+ GC_page_size-1) |
|
# else |
|
# ifdef MSWIN32 |
|
extern ptr_t GC_win32_get_mem(); |
|
# define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes) |
|
# else |
|
# ifdef MACOS |
|
# if defined(USE_TEMPORARY_MEMORY) |
|
extern Ptr GC_MacTemporaryNewPtr(size_t size, |
|
Boolean clearMemory); |
|
# define GET_MEM(bytes) HBLKPTR( \ |
|
GC_MacTemporaryNewPtr(bytes + GC_page_size, true) \ |
|
+ GC_page_size-1) |
|
# else |
|
# define GET_MEM(bytes) HBLKPTR( \ |
|
NewPtrClear(bytes + GC_page_size) + GC_page_size-1) |
|
# endif |
|
# else |
|
# ifdef MSWINCE |
|
extern ptr_t GC_wince_get_mem(); |
|
# define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes) |
|
# else |
|
# if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC) |
|
extern void *GC_amiga_get_mem(size_t size); |
|
define GET_MEM(bytes) HBLKPTR((size_t) \ |
|
GC_amiga_get_mem((size_t)bytes + GC_page_size) \ |
|
+ GC_page_size-1) |
|
# else |
|
extern ptr_t GC_unix_get_mem(); |
|
# define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes) |
|
# endif |
|
# endif |
|
# endif |
|
# endif |
|
# endif |
|
# endif |
|
# endif |
|
|
|
/* Delay any interrupts or signals that may abort this thread. Data */ |
/* Delay any interrupts or signals that may abort this thread. Data */ |
/* structures are in a consistent state outside this pair of calls. */ |
/* structures are in a consistent state outside this pair of calls. */ |
/* ANSI C allows both to be empty (though the standard isn't very */ |
/* ANSI C allows both to be empty (though the standard isn't very */ |
/* clear on that point). Standard malloc implementations are usually */ |
/* clear on that point). Standard malloc implementations are usually */ |
/* neither interruptable nor thread-safe, and thus correspond to */ |
/* neither interruptable nor thread-safe, and thus correspond to */ |
/* empty definitions. */ |
/* empty definitions. */ |
|
/* It probably doesn't make any sense to declare these to be nonempty */ |
|
/* if the code is being optimized, since signal safety relies on some */ |
|
/* ordering constraints that are typically not obeyed by optimizing */ |
|
/* compilers. */ |
# ifdef PCR |
# ifdef PCR |
# define DISABLE_SIGNALS() \ |
# define DISABLE_SIGNALS() \ |
PCR_Th_SetSigMask(PCR_allSigsBlocked,&GC_old_sig_mask) |
PCR_Th_SetSigMask(PCR_allSigsBlocked,&GC_old_sig_mask) |
# define ENABLE_SIGNALS() \ |
# define ENABLE_SIGNALS() \ |
PCR_Th_SetSigMask(&GC_old_sig_mask, NIL) |
PCR_Th_SetSigMask(&GC_old_sig_mask, NIL) |
# else |
# else |
# if defined(SRC_M3) || defined(AMIGA) || defined(SOLARIS_THREADS) \ |
# if defined(THREADS) || defined(AMIGA) \ |
|| defined(MSWIN32) || defined(MSWINCE) || defined(MACOS) \ |
|| defined(MSWIN32) || defined(MSWINCE) || defined(MACOS) \ |
|| defined(DJGPP) || defined(NO_SIGNALS) || defined(IRIX_THREADS) \ |
|| defined(DJGPP) || defined(NO_SIGNALS) |
|| defined(LINUX_THREADS) |
|
/* Also useful for debugging. */ |
/* Also useful for debugging. */ |
/* Should probably use thr_sigsetmask for SOLARIS_THREADS. */ |
/* Should probably use thr_sigsetmask for GC_SOLARIS_THREADS. */ |
# define DISABLE_SIGNALS() |
# define DISABLE_SIGNALS() |
# define ENABLE_SIGNALS() |
# define ENABLE_SIGNALS() |
# else |
# else |
Line 479 struct hblk; /* See below. */ |
|
Line 410 struct hblk; /* See below. */ |
|
PCR_allSigsBlocked, \ |
PCR_allSigsBlocked, \ |
PCR_waitForever); |
PCR_waitForever); |
# else |
# else |
# if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \ |
# if defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) \ |
|| defined(IRIX_THREADS) || defined(LINUX_THREADS) \ |
|| defined(GC_PTHREADS) |
|| defined(HPUX_THREADS) |
|
void GC_stop_world(); |
void GC_stop_world(); |
void GC_start_world(); |
void GC_start_world(); |
# define STOP_WORLD() GC_stop_world() |
# define STOP_WORLD() GC_stop_world() |
Line 499 struct hblk; /* See below. */ |
|
Line 429 struct hblk; /* See below. */ |
|
# ifdef SMALL_CONFIG |
# ifdef SMALL_CONFIG |
# define ABORT(msg) abort(); |
# define ABORT(msg) abort(); |
# else |
# else |
GC_API void GC_abort(); |
GC_API void GC_abort GC_PROTO((GC_CONST char * msg)); |
# define ABORT(msg) GC_abort(msg); |
# define ABORT(msg) GC_abort(msg); |
# endif |
# endif |
# endif |
# endif |
Line 512 struct hblk; /* See below. */ |
|
Line 442 struct hblk; /* See below. */ |
|
# endif |
# endif |
|
|
/* Print warning message, e.g. almost out of memory. */ |
/* Print warning message, e.g. almost out of memory. */ |
# define WARN(msg,arg) (*GC_current_warn_proc)(msg, (GC_word)(arg)) |
# define WARN(msg,arg) (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg)) |
extern GC_warn_proc GC_current_warn_proc; |
extern GC_warn_proc GC_current_warn_proc; |
|
|
/* Get environment entry */ |
/* Get environment entry */ |
Line 566 extern GC_warn_proc GC_current_warn_proc; |
|
Line 496 extern GC_warn_proc GC_current_warn_proc; |
|
# ifdef SMALL_CONFIG |
# ifdef SMALL_CONFIG |
# define CPP_LOG_HBLKSIZE 10 |
# define CPP_LOG_HBLKSIZE 10 |
# else |
# else |
# if CPP_WORDSZ == 32 |
# if (CPP_WORDSZ == 32) || (defined(HPUX) && defined(HP_PA)) |
|
/* HPUX/PA seems to use 4K pages with the 64 bit ABI */ |
# define CPP_LOG_HBLKSIZE 12 |
# define CPP_LOG_HBLKSIZE 12 |
# else |
# else |
# define CPP_LOG_HBLKSIZE 13 |
# define CPP_LOG_HBLKSIZE 13 |
Line 634 extern GC_warn_proc GC_current_warn_proc; |
|
Line 565 extern GC_warn_proc GC_current_warn_proc; |
|
# else |
# else |
# define ALIGNED_WORDS(n) ROUNDED_UP_WORDS(n) |
# define ALIGNED_WORDS(n) ROUNDED_UP_WORDS(n) |
# endif |
# endif |
# define SMALL_OBJ(bytes) ((bytes) < (MAXOBJBYTES -EXTRA_BYTES)) |
# define SMALL_OBJ(bytes) ((bytes) < (MAXOBJBYTES - EXTRA_BYTES)) |
# define ADD_SLOP(bytes) ((bytes) + EXTRA_BYTES) |
# define ADD_SLOP(bytes) ((bytes) + EXTRA_BYTES) |
# ifndef MIN_WORDS |
# ifndef MIN_WORDS |
/* MIN_WORDS is the size of the smallest allocated object. */ |
/* MIN_WORDS is the size of the smallest allocated object. */ |
Line 784 struct hblkhdr { |
|
Line 715 struct hblkhdr { |
|
# define BODY_SZ (HBLKSIZE/sizeof(word)) |
# define BODY_SZ (HBLKSIZE/sizeof(word)) |
|
|
struct hblk { |
struct hblk { |
# if 0 /* DISCARDWORDS no longer supported */ |
|
word garbage[DISCARD_WORDS]; |
|
# endif |
|
word hb_body[BODY_SZ]; |
word hb_body[BODY_SZ]; |
}; |
}; |
|
|
|
# define HBLK_IS_FREE(hdr) ((hdr) -> hb_map == GC_invalid_map) |
|
|
# define OBJ_SZ_TO_BLOCKS(sz) \ |
# define OBJ_SZ_TO_BLOCKS(sz) \ |
divHBLKSZ(WORDS_TO_BYTES(sz) + HBLKSIZE-1) |
divHBLKSZ(WORDS_TO_BYTES(sz) + HBLKSIZE-1) |
/* Size of block (in units of HBLKSIZE) needed to hold objects of */ |
/* Size of block (in units of HBLKSIZE) needed to hold objects of */ |
Line 910 struct _GC_arrays { |
|
Line 840 struct _GC_arrays { |
|
word _mem_freed; |
word _mem_freed; |
/* Number of explicitly deallocated words of memory */ |
/* Number of explicitly deallocated words of memory */ |
/* since last collection. */ |
/* since last collection. */ |
|
word _finalizer_mem_freed; |
|
/* Words of memory explicitly deallocated while */ |
|
/* finalizers were running. Used to approximate mem. */ |
|
/* explicitly deallocated by finalizers. */ |
ptr_t _scratch_end_ptr; |
ptr_t _scratch_end_ptr; |
ptr_t _scratch_last_end_ptr; |
ptr_t _scratch_last_end_ptr; |
/* Used by headers.c, and can easily appear to point to */ |
/* Used by headers.c, and can easily appear to point to */ |
Line 1080 GC_API GC_FAR struct _GC_arrays GC_arrays; |
|
Line 1014 GC_API GC_FAR struct _GC_arrays GC_arrays; |
|
# define GC_words_finalized GC_arrays._words_finalized |
# define GC_words_finalized GC_arrays._words_finalized |
# define GC_non_gc_bytes_at_gc GC_arrays._non_gc_bytes_at_gc |
# define GC_non_gc_bytes_at_gc GC_arrays._non_gc_bytes_at_gc |
# define GC_mem_freed GC_arrays._mem_freed |
# define GC_mem_freed GC_arrays._mem_freed |
|
# define GC_finalizer_mem_freed GC_arrays._finalizer_mem_freed |
# define GC_scratch_end_ptr GC_arrays._scratch_end_ptr |
# define GC_scratch_end_ptr GC_arrays._scratch_end_ptr |
# define GC_scratch_last_end_ptr GC_arrays._scratch_last_end_ptr |
# define GC_scratch_last_end_ptr GC_arrays._scratch_last_end_ptr |
# define GC_mark_procs GC_arrays._mark_procs |
# define GC_mark_procs GC_arrays._mark_procs |
Line 1214 extern struct hblk * GC_hblkfreelist[]; |
|
Line 1149 extern struct hblk * GC_hblkfreelist[]; |
|
/* header structure associated with */ |
/* header structure associated with */ |
/* block. */ |
/* block. */ |
|
|
extern GC_bool GC_is_initialized; /* GC_init() has been run. */ |
|
|
|
extern GC_bool GC_objects_are_marked; /* There are marked objects in */ |
extern GC_bool GC_objects_are_marked; /* There are marked objects in */ |
/* the heap. */ |
/* the heap. */ |
|
|
#ifndef SMALL_CONFIG |
#ifndef SMALL_CONFIG |
extern GC_bool GC_incremental; |
extern GC_bool GC_incremental; |
/* Using incremental/generational collection. */ |
/* Using incremental/generational collection. */ |
|
# define TRUE_INCREMENTAL \ |
|
(GC_incremental && GC_time_limit != GC_TIME_UNLIMITED) |
|
/* True incremental, not just generational, mode */ |
#else |
#else |
# define GC_incremental FALSE |
# define GC_incremental FALSE |
/* Hopefully allow optimizer to remove some code. */ |
/* Hopefully allow optimizer to remove some code. */ |
|
# define TRUE_INCREMENTAL FALSE |
#endif |
#endif |
|
|
extern GC_bool GC_dirty_maintained; |
extern GC_bool GC_dirty_maintained; |
Line 1236 extern word GC_root_size; /* Total size of registered |
|
Line 1173 extern word GC_root_size; /* Total size of registered |
|
|
|
extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called. */ |
extern GC_bool GC_debugging_started; /* GC_debug_malloc has been called. */ |
|
|
|
extern long GC_large_alloc_warn_interval; |
|
/* Interval between unsuppressed warnings. */ |
|
|
|
extern long GC_large_alloc_warn_suppressed; |
|
/* Number of warnings suppressed so far. */ |
|
|
/* Operations */ |
/* Operations */ |
# ifndef abs |
# ifndef abs |
# define abs(x) ((x) < 0? (-(x)) : (x)) |
# define abs(x) ((x) < 0? (-(x)) : (x)) |
Line 1456 void GC_clear_hdr_marks GC_PROTO((hdr * hhdr)); |
|
Line 1398 void GC_clear_hdr_marks GC_PROTO((hdr * hhdr)); |
|
/* Clear the mark bits in a header */ |
/* Clear the mark bits in a header */ |
void GC_set_hdr_marks GC_PROTO((hdr * hhdr)); |
void GC_set_hdr_marks GC_PROTO((hdr * hhdr)); |
/* Set the mark bits in a header */ |
/* Set the mark bits in a header */ |
|
void GC_set_fl_marks GC_PROTO((ptr_t p)); |
|
/* Set all mark bits associated with */ |
|
/* a free list. */ |
void GC_add_roots_inner GC_PROTO((char * b, char * e, GC_bool tmp)); |
void GC_add_roots_inner GC_PROTO((char * b, char * e, GC_bool tmp)); |
GC_bool GC_is_static_root GC_PROTO((ptr_t p)); |
GC_bool GC_is_static_root GC_PROTO((ptr_t p)); |
/* Is the address p in one of the registered static */ |
/* Is the address p in one of the registered static */ |
Line 1484 void GC_bl_init GC_PROTO((void)); |
|
Line 1429 void GC_bl_init GC_PROTO((void)); |
|
/* reference from the heap or static data */ |
/* reference from the heap or static data */ |
# define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \ |
# define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source) \ |
if (GC_all_interior_pointers) { \ |
if (GC_all_interior_pointers) { \ |
GC_add_to_black_list_stack(bits, source); \ |
GC_add_to_black_list_stack(bits, (ptr_t)(source)); \ |
} else { \ |
} else { \ |
GC_add_to_black_list_normal(bits, source); \ |
GC_add_to_black_list_normal(bits, (ptr_t)(source)); \ |
} |
} |
# else |
# else |
void GC_add_to_black_list_normal GC_PROTO((word p)); |
void GC_add_to_black_list_normal GC_PROTO((word p)); |
Line 1623 GC_bool GC_collect_or_expand GC_PROTO(( \ |
|
Line 1568 GC_bool GC_collect_or_expand GC_PROTO(( \ |
|
/* blocks available. Should be called */ |
/* blocks available. Should be called */ |
/* until the blocks are available or */ |
/* until the blocks are available or */ |
/* until it fails by returning FALSE. */ |
/* until it fails by returning FALSE. */ |
GC_API void GC_init GC_PROTO((void)); /* Initialize collector. */ |
|
|
|
|
extern GC_bool GC_is_initialized; /* GC_init() has been run. */ |
|
|
#if defined(MSWIN32) || defined(MSWINCE) |
#if defined(MSWIN32) || defined(MSWINCE) |
void GC_deinit GC_PROTO((void)); |
void GC_deinit GC_PROTO((void)); |
/* Free any resources allocated by */ |
/* Free any resources allocated by */ |
Line 1705 void GC_print_obj GC_PROTO((ptr_t p)); |
|
Line 1651 void GC_print_obj GC_PROTO((ptr_t p)); |
|
/* description of the object to stderr. */ |
/* description of the object to stderr. */ |
extern void (*GC_check_heap) GC_PROTO((void)); |
extern void (*GC_check_heap) GC_PROTO((void)); |
/* Check that all objects in the heap with */ |
/* Check that all objects in the heap with */ |
/* debugging info are intact. Print */ |
/* debugging info are intact. */ |
/* descriptions of any that are not. */ |
/* Add any that are not to GC_smashed list. */ |
|
extern void (*GC_print_all_smashed) GC_PROTO((void)); |
|
/* Print GC_smashed if it's not empty. */ |
|
/* Clear GC_smashed list. */ |
extern void (*GC_print_heap_obj) GC_PROTO((ptr_t p)); |
extern void (*GC_print_heap_obj) GC_PROTO((ptr_t p)); |
/* If possible print s followed by a more */ |
/* If possible print s followed by a more */ |
/* detailed description of the object */ |
/* detailed description of the object */ |
Line 1760 GC_bool GC_page_was_ever_dirty GC_PROTO((struct hblk * |
|
Line 1709 GC_bool GC_page_was_ever_dirty GC_PROTO((struct hblk * |
|
void GC_is_fresh GC_PROTO((struct hblk *h, word n)); |
void GC_is_fresh GC_PROTO((struct hblk *h, word n)); |
/* Assert the region currently contains no */ |
/* Assert the region currently contains no */ |
/* valid pointers. */ |
/* valid pointers. */ |
void GC_write_hint GC_PROTO((struct hblk *h)); |
void GC_remove_protection GC_PROTO((struct hblk *h, word nblocks, |
/* h is about to be written. */ |
GC_bool pointerfree)); |
|
/* h is about to be writteni or allocated. Ensure */ |
|
/* that it's not write protected by the virtual */ |
|
/* dirty bit implementation. */ |
|
|
void GC_dirty_init GC_PROTO((void)); |
void GC_dirty_init GC_PROTO((void)); |
|
|
/* Slow/general mark bit manipulation: */ |
/* Slow/general mark bit manipulation: */ |
Line 1796 void GC_dump GC_PROTO((void)); |
|
Line 1749 void GC_dump GC_PROTO((void)); |
|
|
|
/* Make arguments appear live to compiler */ |
/* Make arguments appear live to compiler */ |
# ifdef __WATCOMC__ |
# ifdef __WATCOMC__ |
void GC_noop(void*, ...); |
void GC_noop(void*, ...); |
# else |
# else |
GC_API void GC_noop(); |
# ifdef __DMC__ |
|
GC_API void GC_noop(...); |
|
# else |
|
GC_API void GC_noop(); |
|
# endif |
# endif |
# endif |
|
|
void GC_noop1 GC_PROTO((word arg)); |
void GC_noop1 GC_PROTO((word)); |
|
|
/* Logging and diagnostic output: */ |
/* Logging and diagnostic output: */ |
GC_API void GC_printf GC_PROTO((GC_CONST char * format, long, long, long, long, long, long)); |
GC_API void GC_printf GC_PROTO((GC_CONST char * format, long, long, long, long, long, long)); |
Line 1859 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
Line 1816 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
# define GC_ASSERT(expr) |
# define GC_ASSERT(expr) |
# endif |
# endif |
|
|
# ifdef PARALLEL_MARK |
# if defined(PARALLEL_MARK) || defined(THREAD_LOCAL_ALLOC) |
/* We need additional synchronization facilities from the thread */ |
/* We need additional synchronization facilities from the thread */ |
/* support. We believe these are less performance critical */ |
/* support. We believe these are less performance critical */ |
/* than the main garbage collector lock; standard pthreads-based */ |
/* than the main garbage collector lock; standard pthreads-based */ |
Line 1878 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
Line 1835 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
|
|
extern void GC_acquire_mark_lock(); |
extern void GC_acquire_mark_lock(); |
extern void GC_release_mark_lock(); |
extern void GC_release_mark_lock(); |
extern void GC_notify_all_marker(); |
|
extern void GC_notify_all_builder(); |
extern void GC_notify_all_builder(); |
extern void GC_wait_marker(); |
|
/* extern void GC_wait_builder(); */ |
/* extern void GC_wait_builder(); */ |
extern void GC_wait_for_reclaim(); |
extern void GC_wait_for_reclaim(); |
|
|
extern word GC_fl_builder_count; /* Protected by mark lock. */ |
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 word GC_mark_no; /* Protected by mark lock. */ |
extern word GC_mark_no; /* Protected by mark lock. */ |
|
|
extern void GC_help_marker(word my_mark_no); |
extern void GC_help_marker(word my_mark_no); |
Line 1893 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
Line 1852 void GC_err_puts GC_PROTO((GC_CONST char *s)); |
|
/* was already done, or there was nothing to do for */ |
/* was already done, or there was nothing to do for */ |
/* some other reason. */ |
/* some other reason. */ |
# endif /* PARALLEL_MARK */ |
# endif /* PARALLEL_MARK */ |
|
|
|
# if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) |
|
/* We define the thread suspension signal here, so that we can refer */ |
|
/* to it in the dirty bit implementation, if necessary. Ideally we */ |
|
/* would allocate a (real-time ?) signal using the standard mechanism.*/ |
|
/* unfortunately, there is no standard mechanism. (There is one */ |
|
/* 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(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 |
|
# else |
|
/* Linuxthreads itself uses SIGUSR1 and SIGUSR2. */ |
|
# define SIG_SUSPEND SIGPWR |
|
# endif |
|
# else /* !GC_LINUX_THREADS */ |
|
# if defined(_SIGRTMIN) |
|
# define SIG_SUSPEND _SIGRTMIN + 6 |
|
# else |
|
# define SIG_SUSPEND SIGRTMIN + 6 |
|
# endif |
|
# endif |
|
# endif /* !SIG_SUSPEND */ |
|
|
|
# endif |
|
|
# endif /* GC_PRIVATE_H */ |
# endif /* GC_PRIVATE_H */ |