diff options
Diffstat (limited to 'include/private/gc_priv.h')
-rw-r--r-- | include/private/gc_priv.h | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 493c71a7..cc36317a 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -442,7 +442,7 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES])); # endif /* 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; /* Get environment entry */ @@ -589,9 +589,10 @@ extern GC_warn_proc GC_current_warn_proc; */ # ifdef LARGE_CONFIG -# define LOG_PHT_ENTRIES 19 /* Collisions likely at 512K blocks, */ - /* which is >= 2GB. Each table takes */ - /* 64KB. */ +# define LOG_PHT_ENTRIES 20 /* Collisions likely at 1M blocks, */ + /* which is >= 4GB. Each table takes */ + /* 128KB, some of which may never be */ + /* touched. */ # else # ifdef SMALL_CONFIG # define LOG_PHT_ENTRIES 14 /* Collisions are likely if heap grows */ @@ -599,7 +600,7 @@ extern GC_warn_proc GC_current_warn_proc; /* Each hash table occupies 2K bytes. */ # else /* default "medium" configuration */ # define LOG_PHT_ENTRIES 16 /* Collisions are likely if heap grows */ - /* to more than 16K hblks >= 256MB. */ + /* to more than 64K hblks >= 256MB. */ /* Each hash table occupies 8K bytes. */ # endif # endif @@ -840,6 +841,10 @@ struct _GC_arrays { word _mem_freed; /* Number of explicitly deallocated words of memory */ /* 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_last_end_ptr; /* Used by headers.c, and can easily appear to point to */ @@ -1010,6 +1015,7 @@ GC_API GC_FAR struct _GC_arrays GC_arrays; # define GC_words_finalized GC_arrays._words_finalized # define GC_non_gc_bytes_at_gc GC_arrays._non_gc_bytes_at_gc # 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_last_end_ptr GC_arrays._scratch_last_end_ptr # define GC_mark_procs GC_arrays._mark_procs @@ -1168,7 +1174,12 @@ extern word GC_root_size; /* Total size of registered root sections */ 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 */ # ifndef abs # define abs(x) ((x) < 0? (-(x)) : (x)) @@ -1641,16 +1652,32 @@ void GC_print_obj GC_PROTO((ptr_t p)); /* description of the object to stderr. */ extern void (*GC_check_heap) GC_PROTO((void)); /* Check that all objects in the heap with */ - /* debugging info are intact. Print */ - /* descriptions of any that are not. */ + /* debugging info are intact. */ + /* 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_all_errors GC_PROTO((void)); + /* Print smashed and leaked objects, if any. */ + /* Clear the lists of such objects. */ extern void (*GC_print_heap_obj) GC_PROTO((ptr_t p)); /* If possible print s followed by a more */ /* detailed description of the object */ /* referred to by p. */ +extern GC_bool GC_have_errors; /* We saw a smashed or leaked object. */ + /* Call error printing routine */ + /* occasionally. */ extern GC_bool GC_print_stats; /* Produce at least some logging output */ /* Set from environment variable. */ +#ifndef NO_DEBUGGING + extern GC_bool GC_dump_regularly; /* Generate regular debugging dumps. */ +# define COND_DUMP if (GC_dump_regularly) GC_dump(); +#else +# define COND_DUMP +#endif + /* Macros used for collector internal allocation. */ /* These assume the collector lock is held. */ #ifdef DBG_HDRS_ALL @@ -1722,6 +1749,7 @@ void GC_print_block_list GC_PROTO((void)); void GC_print_hblkfreelist GC_PROTO((void)); void GC_print_heap_sects GC_PROTO((void)); void GC_print_static_roots GC_PROTO((void)); +void GC_print_finalization_stats GC_PROTO((void)); void GC_dump GC_PROTO((void)); #ifdef KEEP_BACK_PTRS @@ -1858,7 +1886,11 @@ void GC_err_puts GC_PROTO((GC_CONST char *s)); # define SIG_SUSPEND SIGPWR # endif # else /* !GC_LINUX_THREADS */ -# define SIG_SUSPEND _SIGRTMIN + 6 +# if defined(_SIGRTMIN) +# define SIG_SUSPEND _SIGRTMIN + 6 +# else +# define SIG_SUSPEND SIGRTMIN + 6 +# endif # endif # endif /* !SIG_SUSPEND */ |