Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Functions | Variables
gc_priv.h File Reference
#include "../gc.h"
#include "../gc_mark.h"
#include "gcconfig.h"
#include "gc_hdrs.h"
#include "gc_locks.h"
#include <time.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  hblkhdr
struct  hblk
struct  exclusion
struct  roots
struct  _GC_arrays
struct  _GC_arrays::HeapSect
struct  obj_kind


#define TRUE   1
#define FALSE   0
#define VOLATILE
#define EXPECT(expr, outcome)   (expr)
#define COOLER_THAN   >
#define HOTTER_THAN   <
#define MAKE_COOLER(x, y)
#define MAKE_HOTTER(x, y)   (x) -= (y)
#define GC_FAR
#define PRINTSTATS   /* Print garbage collection statistics */
#define PRINTTIMES   /* Print the amount of time consumed by each garbage */
#define PRINTBLOCKS   /* Print object sizes associated with heap blocks, */
#define CONDPRINT   /* Print some things if GC_print_stats is set */
#define GC_INVOKE_FINALIZERS()   GC_notify_or_invoke_finalizers()
#define MERGE_SIZES   /* Round up some object sizes, so that fewer distinct */
#define EXTRA_BYTES   GC_all_interior_pointers
#define MINHINCR   16 /* Minimum heap increment, in blocks of HBLKSIZE */
#define MAXHINCR   2048 /* Maximum heap increment, in blocks */
#define TIME_LIMIT   50 /* We try to keep pause times from exceeding */
#define BL_LIMIT   GC_black_list_spacing
#define CLOCKS_PER_SEC   1000000
#define CLOCK_TYPE   clock_t
#define GET_TIME(x)   x = clock()
#define MS_TIME_DIFF(a, b)
#define BCOPY(x, y, n)   memcpy(y, x, (size_t)(n))
#define BZERO(x, n)   memset(x, 0, (size_t)(n))
#define DISABLE_SIGNALS()   GC_disable_signals()
#define ENABLE_SIGNALS()   GC_enable_signals()
#define STOP_WORLD()
#define START_WORLD()
#define ABORT(msg)   GC_abort(msg);
#define EXIT()   (void)exit(1)
#define WARN(msg, arg)   (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg))
#define GETENV(name)   getenv(name)
#define WORDS_TO_BYTES(x)   ((x)<<2)
#define BYTES_TO_WORDS(x)   ((x)>>2)
#define LOGWL   ((word)5) /* log[2] of CPP_WORDSZ */
#define modWORDSZ(n)   ((n) & 0x1f) /* n mod size of word */
#define WORDSZ   ((word)CPP_WORDSZ)
#define SIGNB   ((word)1 << (WORDSZ-1))
#define BYTES_PER_WORD   ((word)(sizeof (word)))
#define ONES   ((word)(signed_word)(-1))
#define divWORDSZ(n)   ((n) >> LOGWL) /* divide n by size of word */
#define CPP_LOG_HBLKSIZE   12
#define HBLKSIZE   ((word)CPP_HBLKSIZE)
#define MAXOBJSZ   ((word)CPP_MAXOBJSZ)
#define divHBLKSZ(n)   ((n) >> LOG_HBLKSIZE)
#define HBLK_PTR_DIFF(p, q)   divHBLKSZ((ptr_t)p - (ptr_t)q)
#define modHBLKSZ(n)   ((n) & (HBLKSIZE-1))
#define HBLKPTR(objptr)   ((struct hblk *)(((word) (objptr)) & ~(HBLKSIZE-1)))
#define HBLKDISPL(objptr)   (((word) (objptr)) & (HBLKSIZE-1))
#define SMALL_OBJ(bytes)   ((bytes) <= (MAXOBJBYTES - EXTRA_BYTES))
#define ADD_SLOP(bytes)   ((bytes) + EXTRA_BYTES)
#define MIN_WORDS   1
#define LOG_PHT_ENTRIES   16 /* Collisions are likely if heap grows */
#define PHT_ENTRIES   ((word)1 << LOG_PHT_ENTRIES)
#define PHT_HASH(addr)   ((((word)(addr)) >> LOG_HBLKSIZE) & (PHT_ENTRIES - 1))
#define get_pht_entry_from_index(bl, index)   (((bl)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)
#define set_pht_entry_from_index(bl, index)   (bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)
#define clear_pht_entry_from_index(bl, index)   (bl)[divWORDSZ(index)] &= ~((word)1 << modWORDSZ(index))
#define set_pht_entry_from_index_safe(bl, index)   (bl)[divWORDSZ(index)] = ONES
#define IGNORE_OFF_PAGE   1 /* Ignore pointers that do not */
#define WAS_UNMAPPED   2 /* This is a free block, which has */
#define BODY_SZ   (HBLKSIZE/sizeof(word))
#define HBLK_IS_FREE(hdr)   ((hdr) -> hb_map == GC_invalid_map)
#define obj_link(p)   (*(ptr_t *)(p))
#define LOG_MAX_MARK_PROCS   6
#define MAX_ROOT_SETS   1024
#define LOG_RT_SIZE   6
#define RT_SIZE   (1 << LOG_RT_SIZE) /* Power of 2, may be != MAX_ROOT_SETS */
#define OFFSET_TOO_BIG   0xfe
#define OBJ_INVALID   0xff
#define MAP_ENTRY(map, bytes)   (map)[bytes]
#define MAX_OFFSET   ((word)CPP_MAX_OFFSET)
#define OFFSET_VALID(displ)   (GC_all_interior_pointers || GC_valid_offsets[displ])
#define MAX_HEAP_SECTS   384 /* Roughly 3GB */
#define GC_objfreelist   GC_arrays._objfreelist
#define GC_aobjfreelist   GC_arrays._aobjfreelist
#define GC_words_allocd   GC_arrays._words_allocd
#define GC_uobjfreelist   GC_arrays._uobjfreelist
#define GC_sobjfreelist   GC_arrays._sobjfreelist
#define GC_valid_offsets   GC_arrays._valid_offsets
#define GC_modws_valid_offsets   GC_arrays._modws_valid_offsets
#define GC_obj_map   GC_arrays._obj_map
#define GC_last_heap_addr   GC_arrays._last_heap_addr
#define GC_prev_heap_addr   GC_arrays._prev_heap_addr
#define GC_words_wasted   GC_arrays._words_wasted
#define GC_large_free_bytes   GC_arrays._large_free_bytes
#define GC_large_allocd_bytes   GC_arrays._large_allocd_bytes
#define GC_max_large_allocd_bytes   GC_arrays._max_large_allocd_bytes
#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
#define GC_heapsize   GC_arrays._heapsize
#define GC_max_heapsize   GC_arrays._max_heapsize
#define GC_requested_heapsize   GC_arrays._requested_heapsize
#define GC_words_allocd_before_gc   GC_arrays._words_allocd_before_gc
#define GC_heap_sects   GC_arrays._heap_sects
#define GC_last_stack   GC_arrays._last_stack
#define GC_static_roots   GC_arrays._static_roots
#define GC_root_index   GC_arrays._root_index
#define GC_excl_table   GC_arrays._excl_table
#define GC_all_nils   GC_arrays._all_nils
#define GC_top_index   GC_arrays._top_index
#define GC_composite_in_use   GC_arrays._composite_in_use
#define GC_atomic_in_use   GC_arrays._atomic_in_use
#define GC_size_map   GC_arrays._size_map
#define beginGC_arrays   ((ptr_t)(&GC_arrays))
#define endGC_arrays   (((ptr_t)(&GC_arrays)) + (sizeof GC_arrays))
#define USED_HEAP_SIZE   (GC_heapsize - GC_large_free_bytes)
#define MAXOBJKINDS   16
#define beginGC_obj_kinds   ((ptr_t)(&GC_obj_kinds))
#define endGC_obj_kinds   (beginGC_obj_kinds + (sizeof GC_obj_kinds))
#define PTRFREE   0
#define NORMAL   1
#define STUBBORN   3
#define TRUE_INCREMENTAL   (GC_incremental && GC_time_limit != GC_TIME_UNLIMITED)
#define abs(x)   ((x) < 0? (-(x)) : (x))
#define OR_WORD(addr, bits)   *(addr) |= (bits)
#define OR_WORD_EXIT_IF_SET(addr, bits, exit_label)
#define mark_bit_from_hdr(hhdr, n)
#define set_mark_bit_from_hdr(hhdr, n)
#define clear_mark_bit_from_hdr(hhdr, n)
#define GC_ADD_TO_BLACK_LIST_NORMAL(bits, source)
#define GC_gcollect_inner()   (void) GC_try_to_collect_inner(GC_never_stop_func)
#define COND_DUMP   if (GC_dump_regularly) GC_dump();
#define GC_INTERNAL_MALLOC   GC_generic_malloc_inner
#define GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE   GC_generic_malloc_inner_ignore_off_page
#define GC_INTERNAL_FREE   GC_free
#define GC_STORE_BACK_PTR(source, dest)
#define GC_printf0(f)   GC_printf(f, 0l, 0l, 0l, 0l, 0l, 0l)
#define GC_printf1(f, a)   GC_printf(f, (long)a, 0l, 0l, 0l, 0l, 0l)
#define GC_printf2(f, a, b)   GC_printf(f, (long)a, (long)b, 0l, 0l, 0l, 0l)
#define GC_printf3(f, a, b, c)   GC_printf(f, (long)a, (long)b, (long)c, 0l, 0l, 0l)
#define GC_printf4(f, a, b, c, d)
#define GC_printf5(f, a, b, c, d, e)
#define GC_printf6(f, a, b, c, d, e, g)
#define GC_err_printf0(f)   GC_err_puts(f)
#define GC_err_printf1(f, a)   GC_err_printf(f, (long)a, 0l, 0l, 0l, 0l, 0l)
#define GC_err_printf2(f, a, b)   GC_err_printf(f, (long)a, (long)b, 0l, 0l, 0l, 0l)
#define GC_err_printf3(f, a, b, c)
#define GC_err_printf4(f, a, b, c, d)
#define GC_err_printf5(f, a, b, c, d, e)
#define GC_err_printf6(f, a, b, c, d, e, g)
#define GC_ASSERT(expr)
#define GC_STATIC_ASSERT(expr)   sizeof(char[(expr)? 1 : -1])


typedef GC_word word
typedef GC_signed_word signed_word
typedef int GC_bool
typedef char * ptr_t
typedef word page_hash_table [PHT_SIZE]
typedef unsigned char map_entry_type


void GC_disable_signals ()
void GC_enable_signals ()
GC_API void GC_abort GC_PROTO ((GC_CONST char *msg))
ptr_t GC_approx_sp GC_PROTO ((void))
void GC_apply_to_all_blocks GC_PROTO ((void(*fn) GC_PROTO((struct hblk *h, word client_data)), word client_data))
struct hblk *GC_next_used_block GC_PROTO ((struct hblk *h))
GC_bool GC_mark_some GC_PROTO ((ptr_t cold_gc_frame))
void GC_push_all GC_PROTO ((ptr_t bottom, ptr_t top))
void GC_push_selected GC_PROTO ((ptr_t bottom, ptr_t top, int(*dirty_fn) GC_PROTO((struct hblk *h)), void(*push_fn) GC_PROTO((ptr_t bottom, ptr_t top))))
void GC_push_conditional GC_PROTO ((ptr_t b, ptr_t t, GC_bool all))
GC_API void GC_push_all_stack GC_PROTO ((ptr_t b, ptr_t t))
GC_PROTO ((ptr_t bottom, ptr_t top, ptr_t cold_gc_frame))
void GC_push_roots GC_PROTO ((GC_bool all, ptr_t cold_gc_frame))
void GC_push_one GC_PROTO ((word p))
void GC_push_marked GC_PROTO ((struct hblk *h, hdr *hhdr))
GC_bool GC_stopped_mark GC_PROTO ((GC_stop_func stop_func))
void GC_clear_hdr_marks GC_PROTO ((hdr *hhdr))
void GC_set_fl_marks GC_PROTO ((ptr_t p))
void GC_add_roots_inner GC_PROTO ((char *b, char *e, GC_bool tmp))
void GC_remove_roots_inner GC_PROTO ((char *b, char *e))
struct hblk *GC_is_black_listed GC_PROTO ((struct hblk *h, word len))
word GC_number_stack_black_listed GC_PROTO ((struct hblk *start, struct hblk *endp1))
ptr_t GC_scratch_alloc GC_PROTO ((word bytes))
GC_bool GC_add_map_entry GC_PROTO ((word sz))
void GC_register_displacement_inner GC_PROTO ((word offset))
void GC_new_hblk GC_PROTO ((word size_in_words, int kind))
ptr_t GC_build_fl GC_PROTO ((struct hblk *h, word sz, GC_bool clear, ptr_t list))
struct hblk *GC_allochblk GC_PROTO ((word size_in_words, int kind, unsigned flags))
ptr_t GC_alloc_large GC_PROTO ((word lw, int k, unsigned flags))
void GC_freehblk GC_PROTO ((struct hblk *p))
GC_bool GC_expand_hp_inner GC_PROTO ((word n))
void GC_start_reclaim GC_PROTO ((int abort_if_found))
void GC_continue_reclaim GC_PROTO ((word sz, int kind))
GC_bool GC_reclaim_all GC_PROTO ((GC_stop_func stop_func, GC_bool ignore_old))
GC_bool GC_try_to_collect_inner GC_PROTO ((GC_stop_func f))
GC_bool GC_collect_or_expand GC_PROTO ((word needed_blocks, GC_bool ignore_off_page))
void GC_collect_a_little_inner GC_PROTO ((int n))
GC_PROTO ((size_t b, int k))
ptr_t GC_generic_malloc_inner GC_PROTO ((word lb, int k))
GC_PROTO ((word lw, int k))
ptr_t GC_generic_malloc_words_small GC_PROTO ((size_t lw, int k))
GC_PROTO ((size_t lb, int k))
void GC_free_inner (GC_PTR p)
GC_bool GC_install_counts GC_PROTO ((struct hblk *h, word sz))
hdr *GC_find_header GC_PROTO ((ptr_t h))
GC_API GC_PTR GC_make_closure GC_PROTO ((GC_finalization_proc fn, GC_PTR data))
GC_API void
GC_PROTO ((GC_PTR obj, GC_PTR data))
void GC_add_to_heap GC_PROTO ((struct hblk *p, word bytes))
void GC_is_fresh GC_PROTO ((struct hblk *h, word n))
void GC_remove_protection GC_PROTO ((struct hblk *h, word nblocks, GC_bool pointerfree))
GC_API void GC_noop ()
void GC_noop1 GC_PROTO ((word))
GC_API void GC_printf GC_PROTO ((GC_CONST char *format, long, long, long, long, long, long))
void GC_err_puts GC_PROTO ((GC_CONST char *s))


GC_warn_proc GC_current_warn_proc
GC_API GC_FAR struct _GC_arrays
struct obj_kind GC_obj_kinds [MAXOBJKINDS]
int GC_n_kinds
GC_API word GC_fo_entries
word GC_n_heap_sects
word GC_page_size
word GC_total_stack_black_listed
word GC_black_list_spacing
struct hblkGC_hblkfreelist []
GC_bool GC_objects_are_marked
GC_bool GC_incremental
GC_bool GC_dirty_maintained
word GC_root_size
GC_bool GC_debugging_started
long GC_large_alloc_warn_interval
long GC_large_alloc_warn_suppressed
GC_bool GC_is_initialized
GC_bool GC_have_errors
GC_bool GC_print_stats
GC_bool GC_dump_regularly
GC_bool GC_print_back_height

Class Documentation

struct hblkhdr

Definition at line 674 of file gc_priv.h.

Collaboration diagram for hblkhdr:
Class Members
word hb_descr
unsigned char hb_flags
unsigned short hb_last_reclaimed
map_entry_type * hb_map
word hb_marks
struct hblk * hb_next
unsigned char hb_obj_kind
struct hblk * hb_prev
word hb_sz
struct hblk

Definition at line 734 of file gc_priv.h.

Class Members
word hb_body
struct exclusion

Definition at line 769 of file gc_priv.h.

Class Members
ptr_t e_end
ptr_t e_start
struct roots

Definition at line 778 of file gc_priv.h.

Collaboration diagram for roots:
Class Members
ptr_t r_end
struct roots * r_next
ptr_t r_start
GC_bool r_tmp
struct _GC_arrays

Definition at line 813 of file gc_priv.h.

Collaboration diagram for _GC_arrays:
Class Members
bottom_index * _all_nils
ptr_t _aobjfreelist
word _atomic_in_use
word _composite_in_use
word _finalizer_mem_freed
struct HeapSect _heap_sects
word _heapsize
word _large_allocd_bytes
word _large_free_bytes
ptr_t _last_heap_addr
GC_mark_proc _mark_procs
word _max_heapsize
word _max_large_allocd_bytes
word _mem_freed
char _modws_valid_offsets
word _non_gc_bytes_at_gc
map_entry_type * _obj_map
ptr_t _objfreelist
ptr_t _prev_heap_addr
word _requested_heapsize
struct roots * _root_index
ptr_t _scratch_end_ptr
ptr_t _scratch_last_end_ptr
unsigned _size_map
bottom_index * _top_index
ptr_t _uobjfreelist
char _valid_offsets
word _words_allocd
word _words_allocd_before_gc
word _words_finalized
word _words_wasted
struct _GC_arrays::HeapSect

Definition at line 969 of file gc_priv.h.

Class Members
word hs_bytes
ptr_t hs_start
struct obj_kind

Definition at line 1075 of file gc_priv.h.

Collaboration diagram for obj_kind:
Class Members
word ok_descriptor
ptr_t * ok_freelist
GC_bool ok_init
struct hblk ** ok_reclaim_list
GC_bool ok_relocate_descr

Define Documentation

#define ABORT (   msg)    GC_abort(msg);

Definition at line 433 of file gc_priv.h.

#define abs (   x)    ((x) < 0? (-(x)) : (x))

Definition at line 1197 of file gc_priv.h.

#define ADD_SLOP (   bytes)    ((bytes) + EXTRA_BYTES)

Definition at line 581 of file gc_priv.h.


Definition at line 578 of file gc_priv.h.

#define BCOPY (   x,
)    memcpy(y, x, (size_t)(n))

Definition at line 361 of file gc_priv.h.

#define beginGC_arrays   ((ptr_t)(&GC_arrays))

Definition at line 1067 of file gc_priv.h.

#define beginGC_obj_kinds   ((ptr_t)(&GC_obj_kinds))

Definition at line 1091 of file gc_priv.h.


Definition at line 651 of file gc_priv.h.

Definition at line 243 of file gc_priv.h.

#define BODY_SZ   (HBLKSIZE/sizeof(word))

Definition at line 732 of file gc_priv.h.

#define BYTES_PER_WORD   ((word)(sizeof (word)))

Definition at line 495 of file gc_priv.h.

#define BYTES_TO_WORDS (   x)    ((x)>>2)

Definition at line 475 of file gc_priv.h.

#define BZERO (   x,
)    memset(x, 0, (size_t)(n))

Definition at line 362 of file gc_priv.h.

#define clear_mark_bit_from_hdr (   hhdr,
(hhdr)->hb_marks[divWORDSZ(n)] \
                            &= ~((word)1 << modWORDSZ(n))

Definition at line 1254 of file gc_priv.h.

#define clear_pht_entry_from_index (   bl,
)    (bl)[divWORDSZ(index)] &= ~((word)1 << modWORDSZ(index))

Definition at line 633 of file gc_priv.h.

#define CLOCK_TYPE   clock_t

Definition at line 330 of file gc_priv.h.

#define CLOCKS_PER_SEC   1000000

Definition at line 318 of file gc_priv.h.

Definition at line 1720 of file gc_priv.h.

#define CONDPRINT   /* Print some things if GC_print_stats is set */

Definition at line 192 of file gc_priv.h.

#define COOLER_THAN   >

Definition at line 98 of file gc_priv.h.


Definition at line 542 of file gc_priv.h.

#define CPP_LOG_HBLKSIZE   12

Definition at line 513 of file gc_priv.h.


Definition at line 922 of file gc_priv.h.


Definition at line 550 of file gc_priv.h.

Definition at line 552 of file gc_priv.h.

#define DISABLE_SIGNALS ( )    GC_disable_signals()

Definition at line 392 of file gc_priv.h.

#define divHBLKSZ (   n)    ((n) >> LOG_HBLKSIZE)

Definition at line 555 of file gc_priv.h.

#define divWORDSZ (   n)    ((n) >> LOGWL) /* divide n by size of word */

Definition at line 497 of file gc_priv.h.

#define ENABLE_SIGNALS ( )    GC_enable_signals()

Definition at line 394 of file gc_priv.h.

#define endGC_arrays   (((ptr_t)(&GC_arrays)) + (sizeof GC_arrays))

Definition at line 1068 of file gc_priv.h.

#define endGC_obj_kinds   (beginGC_obj_kinds + (sizeof GC_obj_kinds))

Definition at line 1092 of file gc_priv.h.

#define EXIT ( )    (void)exit(1)

Definition at line 441 of file gc_priv.h.

#define EXPECT (   expr,
)    (expr)

Definition at line 90 of file gc_priv.h.

Definition at line 225 of file gc_priv.h.

#define FALSE   0

Definition at line 58 of file gc_priv.h.


Definition at line 188 of file gc_priv.h.

#define GC_ADD_TO_BLACK_LIST_NORMAL (   bits,
if (GC_all_interior_pointers) { \
                GC_add_to_black_list_stack(bits); \
              } else { \
                GC_add_to_black_list_normal(bits); \

Definition at line 1466 of file gc_priv.h.

#define GC_all_nils   GC_arrays._all_nils

Definition at line 1048 of file gc_priv.h.

#define GC_aobjfreelist   GC_arrays._aobjfreelist

Definition at line 1002 of file gc_priv.h.

#define GC_ASSERT (   expr)

Definition at line 1887 of file gc_priv.h.

#define GC_atomic_in_use   GC_arrays._atomic_in_use

Definition at line 1061 of file gc_priv.h.

#define GC_composite_in_use   GC_arrays._composite_in_use

Definition at line 1060 of file gc_priv.h.

#define GC_err_printf0 (   f)    GC_err_puts(f)

Definition at line 1855 of file gc_priv.h.

#define GC_err_printf1 (   f,
)    GC_err_printf(f, (long)a, 0l, 0l, 0l, 0l, 0l)

Definition at line 1856 of file gc_priv.h.

#define GC_err_printf2 (   f,
)    GC_err_printf(f, (long)a, (long)b, 0l, 0l, 0l, 0l)

Definition at line 1857 of file gc_priv.h.

#define GC_err_printf3 (   f,
GC_err_printf(f, (long)a, (long)b, (long)c, \
                                            0l, 0l, 0l)

Definition at line 1858 of file gc_priv.h.

#define GC_err_printf4 (   f,
GC_err_printf(f, (long)a, (long)b, \
                                              (long)c, (long)d, 0l, 0l)

Definition at line 1860 of file gc_priv.h.

#define GC_err_printf5 (   f,
GC_err_printf(f, (long)a, (long)b, \
                                                (long)c, (long)d, \
                                                (long)e, 0l)

Definition at line 1862 of file gc_priv.h.

#define GC_err_printf6 (   f,
GC_err_printf(f, (long)a, (long)b, \
                                                 (long)c, (long)d, \
                                                 (long)e, (long)g)

Definition at line 1865 of file gc_priv.h.

#define GC_excl_table   GC_arrays._excl_table

Definition at line 1047 of file gc_priv.h.

#define GC_FAR

Definition at line 113 of file gc_priv.h.

#define GC_finalizer_mem_freed   GC_arrays._finalizer_mem_freed

Definition at line 1026 of file gc_priv.h.

#define GC_gcollect_inner ( )    (void) GC_try_to_collect_inner(GC_never_stop_func)

Definition at line 1587 of file gc_priv.h.

#define GC_heap_sects   GC_arrays._heap_sects

Definition at line 1034 of file gc_priv.h.

#define GC_heapsize   GC_arrays._heapsize

Definition at line 1030 of file gc_priv.h.

#define GC_INTERNAL_FREE   GC_free

Definition at line 1757 of file gc_priv.h.

Definition at line 1751 of file gc_priv.h.

Definition at line 1752 of file gc_priv.h.

#define GC_INVOKE_FINALIZERS ( )    GC_notify_or_invoke_finalizers()

Definition at line 195 of file gc_priv.h.

#define GC_large_allocd_bytes   GC_arrays._large_allocd_bytes

Definition at line 1021 of file gc_priv.h.

#define GC_large_free_bytes   GC_arrays._large_free_bytes

Definition at line 1020 of file gc_priv.h.

#define GC_last_heap_addr   GC_arrays._last_heap_addr

Definition at line 1017 of file gc_priv.h.

#define GC_last_stack   GC_arrays._last_stack

Definition at line 1035 of file gc_priv.h.

#define GC_mark_procs   GC_arrays._mark_procs

Definition at line 1029 of file gc_priv.h.


Definition at line 1818 of file gc_priv.h.

#define GC_max_heapsize   GC_arrays._max_heapsize

Definition at line 1031 of file gc_priv.h.

#define GC_max_large_allocd_bytes   GC_arrays._max_large_allocd_bytes

Definition at line 1022 of file gc_priv.h.

#define GC_mem_freed   GC_arrays._mem_freed

Definition at line 1025 of file gc_priv.h.

#define GC_modws_valid_offsets   GC_arrays._modws_valid_offsets

Definition at line 1011 of file gc_priv.h.

#define GC_non_gc_bytes_at_gc   GC_arrays._non_gc_bytes_at_gc

Definition at line 1024 of file gc_priv.h.

#define GC_obj_map   GC_arrays._obj_map

Definition at line 1016 of file gc_priv.h.

#define GC_objfreelist   GC_arrays._objfreelist

Definition at line 1001 of file gc_priv.h.

#define GC_prev_heap_addr   GC_arrays._prev_heap_addr

Definition at line 1018 of file gc_priv.h.

#define GC_printf0 (   f)    GC_printf(f, 0l, 0l, 0l, 0l, 0l, 0l)

Definition at line 1843 of file gc_priv.h.

#define GC_printf1 (   f,
)    GC_printf(f, (long)a, 0l, 0l, 0l, 0l, 0l)

Definition at line 1844 of file gc_priv.h.

#define GC_printf2 (   f,
)    GC_printf(f, (long)a, (long)b, 0l, 0l, 0l, 0l)

Definition at line 1845 of file gc_priv.h.

#define GC_printf3 (   f,
)    GC_printf(f, (long)a, (long)b, (long)c, 0l, 0l, 0l)

Definition at line 1846 of file gc_priv.h.

#define GC_printf4 (   f,
GC_printf(f, (long)a, (long)b, (long)c, \
                                       (long)d, 0l, 0l)

Definition at line 1847 of file gc_priv.h.

#define GC_printf5 (   f,
GC_printf(f, (long)a, (long)b, (long)c, \
                                         (long)d, (long)e, 0l)

Definition at line 1849 of file gc_priv.h.

#define GC_printf6 (   f,
GC_printf(f, (long)a, (long)b, (long)c, \
                                          (long)d, (long)e, (long)g)

Definition at line 1851 of file gc_priv.h.

#define GC_requested_heapsize   GC_arrays._requested_heapsize

Definition at line 1032 of file gc_priv.h.

#define GC_root_index   GC_arrays._root_index

Definition at line 1046 of file gc_priv.h.

#define GC_scratch_end_ptr   GC_arrays._scratch_end_ptr

Definition at line 1027 of file gc_priv.h.

#define GC_scratch_last_end_ptr   GC_arrays._scratch_last_end_ptr

Definition at line 1028 of file gc_priv.h.

#define GC_size_map   GC_arrays._size_map

Definition at line 1064 of file gc_priv.h.

#define GC_sobjfreelist   GC_arrays._sobjfreelist

Definition at line 1009 of file gc_priv.h.

#define GC_STATIC_ASSERT (   expr)    sizeof(char[(expr)? 1 : -1])

Definition at line 1897 of file gc_priv.h.

#define GC_static_roots   GC_arrays._static_roots

Definition at line 1045 of file gc_priv.h.

#define GC_STORE_BACK_PTR (   source,

Definition at line 1817 of file gc_priv.h.

#define GC_top_index   GC_arrays._top_index

Definition at line 1049 of file gc_priv.h.

#define GC_uobjfreelist   GC_arrays._uobjfreelist

Definition at line 1005 of file gc_priv.h.

#define GC_valid_offsets   GC_arrays._valid_offsets

Definition at line 1010 of file gc_priv.h.

#define GC_words_allocd   GC_arrays._words_allocd

Definition at line 1003 of file gc_priv.h.

#define GC_words_allocd_before_gc   GC_arrays._words_allocd_before_gc

Definition at line 1033 of file gc_priv.h.

#define GC_words_finalized   GC_arrays._words_finalized

Definition at line 1023 of file gc_priv.h.

#define GC_words_wasted   GC_arrays._words_wasted

Definition at line 1019 of file gc_priv.h.

#define get_pht_entry_from_index (   bl,
)    (((bl)[divWORDSZ(index)] >> modWORDSZ(index)) & 1)

Definition at line 629 of file gc_priv.h.

#define GET_TIME (   x)    x = clock()

Definition at line 331 of file gc_priv.h.

#define GETENV (   name)    getenv(name)

Definition at line 461 of file gc_priv.h.

#define HBLK_IS_FREE (   hdr)    ((hdr) -> hb_map == GC_invalid_map)

Definition at line 738 of file gc_priv.h.

#define HBLK_PTR_DIFF (   p,
)    divHBLKSZ((ptr_t)p - (ptr_t)q)

Definition at line 557 of file gc_priv.h.

#define HBLKDISPL (   objptr)    (((word) (objptr)) & (HBLKSIZE-1))

Definition at line 569 of file gc_priv.h.


Definition at line 649 of file gc_priv.h.

#define HBLKPTR (   objptr)    ((struct hblk *)(((word) (objptr)) & ~(HBLKSIZE-1)))

Definition at line 567 of file gc_priv.h.

#define HBLKSIZE   ((word)CPP_HBLKSIZE)

Definition at line 544 of file gc_priv.h.

#define HOTTER_THAN   <

Definition at line 99 of file gc_priv.h.

#define IGNORE_OFF_PAGE   1 /* Ignore pointers that do not */

Definition at line 693 of file gc_priv.h.

#define IS_UNCOLLECTABLE (   k)    ((k) == UNCOLLECTABLE)

Definition at line 1123 of file gc_priv.h.

Definition at line 543 of file gc_priv.h.

#define LOG_MAX_MARK_PROCS   6

Definition at line 748 of file gc_priv.h.

#define LOG_PHT_ENTRIES   16 /* Collisions are likely if heap grows */

Definition at line 614 of file gc_priv.h.

#define LOG_RT_SIZE   6

Definition at line 790 of file gc_priv.h.

#define LOGWL   ((word)5) /* log[2] of CPP_WORDSZ */

Definition at line 476 of file gc_priv.h.

#define MAKE_COOLER (   x,
if ((word)(x)+(y) > (word)(x)) {(x) += (y);} \
                         else {(x) = (word)ONES;}

Definition at line 100 of file gc_priv.h.

#define MAKE_HOTTER (   x,
)    (x) -= (y)

Definition at line 102 of file gc_priv.h.


Definition at line 920 of file gc_priv.h.

#define MAP_ENTRY (   map,
)    (map)[bytes]

Definition at line 919 of file gc_priv.h.


Definition at line 921 of file gc_priv.h.

#define mark_bit_from_hdr (   hhdr,
(((hhdr)->hb_marks[divWORDSZ(n)] \
                         >> (modWORDSZ(n))) & (word)1)

Definition at line 1249 of file gc_priv.h.

Definition at line 653 of file gc_priv.h.

Definition at line 666 of file gc_priv.h.


Definition at line 763 of file gc_priv.h.

#define MAX_HEAP_SECTS   384 /* Roughly 3GB */

Definition at line 966 of file gc_priv.h.


Definition at line 749 of file gc_priv.h.

#define MAX_OFFSET   ((word)CPP_MAX_OFFSET)

Definition at line 923 of file gc_priv.h.

#define MAX_ROOT_SETS   1024

Definition at line 760 of file gc_priv.h.

#define MAXHINCR   2048 /* Maximum heap increment, in blocks */

Definition at line 234 of file gc_priv.h.


Definition at line 551 of file gc_priv.h.

#define MAXOBJKINDS   16

Definition at line 1073 of file gc_priv.h.

#define MAXOBJSZ   ((word)CPP_MAXOBJSZ)

Definition at line 553 of file gc_priv.h.

#define MERGE_SIZES   /* Round up some object sizes, so that fewer distinct */

Definition at line 197 of file gc_priv.h.

#define MIN_WORDS   1

Definition at line 592 of file gc_priv.h.

#define MINHINCR   16 /* Minimum heap increment, in blocks of HBLKSIZE */

Definition at line 232 of file gc_priv.h.

#define modHBLKSZ (   n)    ((n) & (HBLKSIZE-1))

Definition at line 565 of file gc_priv.h.

#define modWORDSZ (   n)    ((n) & 0x1f) /* n mod size of word */

Definition at line 477 of file gc_priv.h.

#define MS_TIME_DIFF (   a,
((unsigned long) \

Definition at line 332 of file gc_priv.h.

#define NORMAL   1

Definition at line 1115 of file gc_priv.h.

#define OBJ_INVALID   0xff

Definition at line 918 of file gc_priv.h.

#define obj_link (   p)    (*(ptr_t *)(p))

Definition at line 746 of file gc_priv.h.

Definition at line 740 of file gc_priv.h.

#define OFFSET_TOO_BIG   0xfe

Definition at line 917 of file gc_priv.h.

#define OFFSET_VALID (   displ)    (GC_all_interior_pointers || GC_valid_offsets[displ])

Definition at line 935 of file gc_priv.h.

#define ONES   ((word)(signed_word)(-1))

Definition at line 496 of file gc_priv.h.

#define OR_WORD (   addr,
)    *(addr) |= (bits)

Definition at line 1224 of file gc_priv.h.

#define OR_WORD_EXIT_IF_SET (   addr,
{ \
	  word old = *(addr); \
	  word my_bits = (bits); \
         if (old & my_bits) goto exit_label; \
         *(addr) = (old | my_bits); \

Definition at line 1225 of file gc_priv.h.

#define PHT_ENTRIES   ((word)1 << LOG_PHT_ENTRIES)

Definition at line 623 of file gc_priv.h.

#define PHT_HASH (   addr)    ((((word)(addr)) >> LOG_HBLKSIZE) & (PHT_ENTRIES - 1))

Definition at line 627 of file gc_priv.h.


Definition at line 624 of file gc_priv.h.

#define PRINTBLOCKS   /* Print object sizes associated with heap blocks, */

Definition at line 168 of file gc_priv.h.

#define PRINTSTATS   /* Print garbage collection statistics */

Definition at line 162 of file gc_priv.h.

#define PRINTTIMES   /* Print the amount of time consumed by each garbage */

Definition at line 165 of file gc_priv.h.

#define PTRFREE   0

Definition at line 1114 of file gc_priv.h.


Definition at line 572 of file gc_priv.h.

#define RT_SIZE   (1 << LOG_RT_SIZE) /* Power of 2, may be != MAX_ROOT_SETS */

Definition at line 791 of file gc_priv.h.

#define set_mark_bit_from_hdr (   hhdr,
OR_WORD((hhdr)->hb_marks+divWORDSZ(n), \
                                (word)1 << modWORDSZ(n))

Definition at line 1251 of file gc_priv.h.

#define set_pht_entry_from_index (   bl,
)    (bl)[divWORDSZ(index)] |= (word)1 << modWORDSZ(index)

Definition at line 631 of file gc_priv.h.

#define set_pht_entry_from_index_safe (   bl,
)    (bl)[divWORDSZ(index)] = ONES

Definition at line 637 of file gc_priv.h.

#define SIGNB   ((word)1 << (WORDSZ-1))

Definition at line 494 of file gc_priv.h.

#define SMALL_OBJ (   bytes)    ((bytes) <= (MAXOBJBYTES - EXTRA_BYTES))

Definition at line 580 of file gc_priv.h.

#define START_WORLD ( )

Definition at line 421 of file gc_priv.h.

#define STOP_WORLD ( )

Definition at line 420 of file gc_priv.h.

#define STUBBORN   3

Definition at line 1122 of file gc_priv.h.

#define TIME_LIMIT   50 /* We try to keep pause times from exceeding */

Definition at line 240 of file gc_priv.h.

#define TRUE   1

Definition at line 57 of file gc_priv.h.

Definition at line 1167 of file gc_priv.h.


Definition at line 479 of file gc_priv.h.


Definition at line 1116 of file gc_priv.h.

Definition at line 1070 of file gc_priv.h.


Definition at line 925 of file gc_priv.h.

#define VOLATILE

Definition at line 83 of file gc_priv.h.

#define WARN (   msg,
)    (*GC_current_warn_proc)("GC Warning: " msg, (GC_word)(arg))

Definition at line 445 of file gc_priv.h.

#define WAS_UNMAPPED   2 /* This is a free block, which has */

Definition at line 696 of file gc_priv.h.

#define WORDS_TO_BYTES (   x)    ((x)<<2)

Definition at line 474 of file gc_priv.h.

#define WORDSZ   ((word)CPP_WORDSZ)

Definition at line 493 of file gc_priv.h.

Typedef Documentation

typedef int GC_bool

Definition at line 56 of file gc_priv.h.

typedef unsigned char map_entry_type

Definition at line 672 of file gc_priv.h.

Definition at line 625 of file gc_priv.h.

typedef char* ptr_t

Definition at line 60 of file gc_priv.h.

Definition at line 54 of file gc_priv.h.

typedef GC_word word

Definition at line 53 of file gc_priv.h.

Function Documentation

Definition at line 534 of file os_dep.c.

    if (!mask_initialized) {

       SIG_DEL(new_mask, SIGSEGV);
       SIG_DEL(new_mask, SIGILL);
       SIG_DEL(new_mask, SIGQUIT);
#      ifdef SIGBUS
           SIG_DEL(new_mask, SIGBUS);
#      endif
#      ifdef SIGIOT
           SIG_DEL(new_mask, SIGIOT);
#      endif
#      ifdef SIGEMT
           SIG_DEL(new_mask, SIGEMT);
#      endif
#      ifdef SIGTRAP
           SIG_DEL(new_mask, SIGTRAP);
#      endif 
       mask_initialized = TRUE;
       if (GC_sig_disabled != 0) ABORT("Nested disables");
#   endif

Definition at line 563 of file os_dep.c.

       if (GC_sig_disabled != 1) ABORT("Unmatched enable");
#   endif

Definition at line 31 of file mark.c.


Here is the caller graph for this function:

GC_API void GC_abort GC_PROTO ( (GC_CONST char *msg)  )

Definition at line 117 of file alloc.c.

{ return(0); }

Here is the call graph for this function:

void GC_apply_to_all_blocks GC_PROTO ( (void(*fn) GC_PROTO((struct hblk *h, word client_data)), word client_data)  )
GC_bool GC_mark_some GC_PROTO ( (ptr_t cold_gc_frame)  )
void GC_push_all GC_PROTO ( (ptr_t bottom, ptr_t top)  )
void GC_push_selected GC_PROTO ( (ptr_t bottom, ptr_t top, int(*dirty_fn) GC_PROTO((struct hblk *h)), void(*push_fn) GC_PROTO((ptr_t bottom, ptr_t top)))  )
void GC_push_all_stack_partially_eager GC_PROTO ( (ptr_t bottom, ptr_t top, ptr_t cold_gc_frame)  )
void GC_push_roots GC_PROTO ( (GC_bool all, ptr_t cold_gc_frame)  )
GC_bool GC_stopped_mark GC_PROTO ( (GC_stop_func stop_func)  )
void GC_add_roots_inner GC_PROTO ( (char *b, char *e, GC_bool tmp)  )
void GC_remove_roots_inner GC_PROTO ( (char *b, char *e)  )
void GC_new_hblk GC_PROTO ( (word size_in_words, int kind)  )
struct hblk* GC_allochblk GC_PROTO ( (word size_in_words, int kind, unsigned flags ) [read]
ptr_t GC_alloc_large GC_PROTO ( (word lw, int k, unsigned flags )
void GC_start_reclaim GC_PROTO ( (int abort_if_found)  )
GC_bool GC_reclaim_all GC_PROTO ( (GC_stop_func stop_func, GC_bool ignore_old)  )
GC_bool GC_try_to_collect_inner GC_PROTO ( (GC_stop_func f)  )
GC_bool GC_collect_or_expand GC_PROTO ( (word needed_blocks, GC_bool ignore_off_page)  )
void GC_is_fresh GC_PROTO ( (struct hblk *h, word n)  )
void GC_remove_protection GC_PROTO ( (struct hblk *h, word nblocks, GC_bool pointerfree)  )
GC_API void GC_printf GC_PROTO ( (GC_CONST char *format, long, long, long, long, long, long)  )
void GC_err_puts GC_PROTO ( (GC_CONST char *s)  )

Variable Documentation

Definition at line 998 of file gc_priv.h.

Definition at line 51 of file blacklst.c.

GC_warn_proc GC_current_warn_proc

Definition at line 1029 of file misc.c.

Definition at line 95 of file misc.c.

Definition at line 2096 of file os_dep.c.

Definition at line 120 of file misc.c.

Definition at line 1128 of file gc_priv.h.

Definition at line 37 of file reclaim.c.

Definition at line 47 of file allchblk.c.

Definition at line 63 of file alloc.c.

Definition at line 24 of file obj_map.c.

Definition at line 473 of file misc.c.

Definition at line 140 of file misc.c.

Definition at line 143 of file misc.c.

Definition at line 819 of file alloc.c.

Definition at line 81 of file mark.c.

Definition at line 123 of file mark.c.


Definition at line 583 of file os_dep.c.

Definition at line 117 of file misc.c.

Definition at line 115 of file misc.c.

Definition at line 154 of file mark_rts.c.

Definition at line 49 of file blacklst.c.