Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
gc_priv.h File Reference
#include "gc.h"
#include "gcconfig.h"
#include "gc_hdrs.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.

Classes

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

Defines

#define TRUE   1
#define FALSE   0
#define VOLATILE
#define CONST
#define GC_FAR
#define STUBBORN_ALLOC   /* Define stubborn allocation primitives */
#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 GATHERSTATS
#define GC_INVOKE_FINALIZERS()   (void)GC_invoke_finalizers()
#define MERGE_SIZES   /* Round up some object sizes, so that fewer distinct */
#define EXACT_FIRST   /* Make a complete pass through the large object */
#define PRESERVE_LAST   /* Do not divide last allocated heap segment */
#define MINHINCR   16 /* Minimum heap increment, in blocks of HBLKSIZE */
#define MAXHINCR   512 /* 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 GET_MEM(bytes)   (struct hblk *)GC_unix_get_mem(bytes)
#define LOCK()
#define UNLOCK()
#define SET_LOCK_HOLDER()
#define UNSET_LOCK_HOLDER()
#define I_HOLD_LOCK()   FALSE
#define ENTER_GC()
#define EXIT_GC()
#define DCL_LOCK_STATE
#define FASTLOCK()   LOCK()
#define FASTLOCK_SUCCEEDED()   TRUE
#define FASTUNLOCK()   UNLOCK()
#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)(msg, (GC_word)(arg))
#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 UNALIGNED
#define WORDSZ   ((word)CPP_WORDSZ)
#define SIGNB   ((word)1 << (WORDSZ-1))
#define BYTES_PER_WORD   ((word)(sizeof (word)))
#define ONES   ((word)(-1))
#define divWORDSZ(n)   ((n) >> LOGWL) /* divide n by size of word */
#define CPP_LOG_HBLKSIZE   12
#define CPP_HBLKSIZE   (1 << CPP_LOG_HBLKSIZE)
#define LOG_HBLKSIZE   ((word)CPP_LOG_HBLKSIZE)
#define HBLKSIZE   ((word)CPP_HBLKSIZE)
#define CPP_MAXOBJSZ   BYTES_TO_WORDS(CPP_HBLKSIZE/2)
#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 ROUNDED_UP_WORDS(n)   BYTES_TO_WORDS((n) + (WORDS_TO_BYTES(1) - 1))
#define ALIGNED_WORDS(n)   ROUNDED_UP_WORDS(n)
#define SMALL_OBJ(bytes)   ((bytes) <= WORDS_TO_BYTES(MAXOBJSZ))
#define ADD_SLOP(bytes)   (bytes)
#define LOG_PHT_ENTRIES   14 /* Collisions are likely if heap grows */
#define PHT_ENTRIES   ((word)1 << LOG_PHT_ENTRIES)
#define PHT_SIZE   (PHT_ENTRIES >> LOGWL)
#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 HBLKMASK   (HBLKSIZE-1)
#define BITS_PER_HBLK   (HBLKSIZE * 8)
#define MARK_BITS_PER_HBLK   (BITS_PER_HBLK/CPP_WORDSZ)
#define MARK_BITS_SZ   ((MARK_BITS_PER_HBLK + CPP_WORDSZ - 1)/CPP_WORDSZ)
#define IGNORE_OFF_PAGE   1 /* Ignore pointers that do not */
#define DISCARD_WORDS   0
#define BODY_SZ   ((HBLKSIZE-WORDS_TO_BYTES(DISCARD_WORDS))/sizeof(word))
#define HDR_WORDS   ((word)DISCARD_WORDS)
#define HDR_BYTES   ((word)WORDS_TO_BYTES(DISCARD_WORDS))
#define OBJ_SZ_TO_BLOCKS(sz)   divHBLKSZ(HDR_BYTES + WORDS_TO_BYTES(sz) + HBLKSIZE-1)
#define obj_link(p)   (*(ptr_t *)(p))
#define LOG_MAX_MARK_PROCS   6
#define MAX_MARK_PROCS   (1 << LOG_MAX_MARK_PROCS)
#define MAX_ROOT_SETS   64
#define MAX_EXCLUSIONS   (MAX_ROOT_SETS/4)
#define LOG_RT_SIZE   6
#define RT_SIZE   (1 << LOG_RT_SIZE) /* Power of 2, may be != MAX_ROOT_SETS */
#define map_entry_type   char
#define OBJ_INVALID   0x7f
#define MAP_ENTRY(map, bytes)   (map)[bytes]
#define MAP_ENTRIES   HBLKSIZE
#define MAP_SIZE   MAP_ENTRIES
#define CPP_MAX_OFFSET   (WORDS_TO_BYTES(OBJ_INVALID) - 1)
#define MAX_OFFSET   ((word)CPP_MAX_OFFSET)
#define VALID_OFFSET_SZ
#define OFFSET_VALID(displ)   GC_valid_offsets[displ]
#define MAX_HEAP_SECTS   256
#define GC_objfreelist   GC_arrays._objfreelist
#define GC_aobjfreelist   GC_arrays._aobjfreelist
#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_changed_pages   GC_arrays._changed_pages
#define GC_prev_changed_pages   GC_arrays._prev_changed_pages
#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_allocd   GC_arrays._words_allocd
#define GC_words_wasted   GC_arrays._words_wasted
#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_mark_procs   GC_arrays._mark_procs
#define GC_heapsize   GC_arrays._heapsize
#define GC_max_heapsize   GC_arrays._max_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 MAXOBJKINDS   16
#define endGC_obj_kinds   (((ptr_t)(&GC_obj_kinds)) + (sizeof GC_obj_kinds))
#define end_gc_area
#define PTRFREE   0
#define NORMAL   1
#define UNCOLLECTABLE   2
#define STUBBORN   3
#define IS_UNCOLLECTABLE(k)   ((k) == UNCOLLECTABLE)
#define abs(x)   ((x) < 0? (-(x)) : (x))
#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)   GC_add_to_black_list_normal(bits)
#define GC_gcollect_inner()   (void) GC_try_to_collect_inner(GC_never_stop_func)
#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)

Typedefs

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 struct ms_entry *(* mark_proc )()

Functions

ptr_t GC_unix_get_mem ()
void GC_disable_signals ()
void GC_enable_signals ()
GC_API void GC_abort ()
ptr_t GC_approx_sp ()
GC_bool GC_should_collect ()
GC_bool GC_in_last_heap_sect ()
void GC_apply_to_all_blocks ()
struct hblkGC_next_block ()
void GC_mark_init ()
void GC_clear_marks ()
void GC_invalidate_mark_state ()
void GC_mark_from_mark_stack ()
GC_bool GC_mark_stack_empty ()
GC_bool GC_mark_some ()
void GC_initiate_gc ()
void GC_push_all ()
void GC_push_dirty ()
void GC_push_conditional ()
void GC_push_all_stack ()
void GC_push_all_eager ()
void GC_push_all_stack_partially_eager ()
void GC_push_current_stack ()
void GC_push_roots ()
void GC_push_regs ()
void GC_remark ()
void GC_push_one ()
void GC_push_one_checked ()
void GC_push_marked ()
struct hblkGC_push_next_marked_dirty ()
struct hblkGC_push_next_marked ()
struct hblkGC_push_next_marked_uncollectable ()
GC_bool GC_stopped_mark ()
void GC_clear_hdr_marks ()
void GC_set_hdr_marks ()
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))
GC_bool GC_is_static_root ()
void GC_register_dynamic_libraries ()
ptr_t GC_get_stack_base ()
void GC_register_data_segments ()
void GC_bl_init ()
void GC_add_to_black_list_normal ()
void GC_add_to_black_list_stack ()
struct hblkGC_is_black_listed ()
void GC_promote_black_lists ()
void GC_unpromote_black_lists ()
word GC_number_stack_black_listed ()
ptr_t GC_scratch_alloc ()
void GC_invalidate_map ()
GC_bool GC_add_map_entry ()
void GC_register_displacement_inner ()
void GC_new_hblk ()
struct hblkGC_allochblk ()
void GC_freehblk ()
void GC_init_inner ()
GC_bool GC_expand_hp_inner ()
void GC_start_reclaim ()
void GC_continue_reclaim ()
void GC_reclaim_or_delete_all ()
GC_bool GC_reclaim_all ()
GC_bool GC_block_empty ()
GC_bool GC_never_stop_func ()
GC_bool GC_try_to_collect_inner ()
void GC_finish_collection ()
GC_bool GC_collect_or_expand ()
GC_API void GC_init ()
void GC_collect_a_little_inner ()
ptr_t GC_generic_malloc ()
ptr_t GC_generic_malloc_ignore_off_page ()
ptr_t GC_generic_malloc_inner ()
ptr_t GC_generic_malloc_words_small GC_PROTO ((size_t words, int kind))
ptr_t GC_generic_malloc_inner_ignore_off_page ()
ptr_t GC_allocobj ()
void GC_init_headers ()
GC_bool GC_install_header ()
GC_bool GC_install_counts ()
void GC_remove_header ()
void GC_remove_counts ()
hdrGC_find_header ()
void GC_finalize ()
void GC_add_to_heap ()
void GC_print_obj ()
void GC_read_dirty ()
GC_bool GC_page_was_dirty ()
GC_bool GC_page_was_ever_dirty ()
void GC_is_fresh ()
void GC_write_hint ()
void GC_dirty_init ()
GC_API GC_bool GC_is_marked ()
void GC_clear_mark_bit ()
void GC_set_mark_bit ()
void GC_read_changed ()
GC_bool GC_page_was_changed ()
void GC_clean_changing_list ()
void GC_stubborn_init ()
void GC_print_block_list ()
void GC_print_hblkfreelist ()
void GC_print_heap_sects ()
void GC_print_static_roots ()
void GC_dump ()
GC_API void GC_noop ()
void GC_noop1 ()
GC_API void GC_printf GC_PROTO ((char *format, long, long, long, long, long, long))
void GC_err_printf ()
void GC_err_puts ()

Variables

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
 OS/2.
word GC_total_stack_black_listed
word GC_black_list_spacing
char * GC_invalid_map
struct hblkGC_hblkfreelist
GC_bool GC_is_initialized
GC_bool GC_objects_are_marked
GC_bool GC_incremental
GC_bool GC_dirty_maintained
word GC_root_size
GC_bool GC_debugging_started
ptr_t GC_least_plausible_heap_addr
ptr_t GC_greatest_plausible_heap_addr
void(* GC_push_other_roots )()
void(* GC_start_call_back )()
void(* GC_check_heap )()
void(* GC_print_heap_obj )()

Class Documentation

struct hblkhdr

Definition at line 837 of file gc_priv.h.

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

Definition at line 878 of file gc_priv.h.

Class Members
word hb_body
struct exclusion

Definition at line 930 of file gc_priv.h.

Class Members
ptr_t e_end
ptr_t e_start
struct roots

Definition at line 939 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 974 of file gc_priv.h.

Collaboration diagram for _GC_arrays:
Class Members
bottom_index * _all_nils
ptr_t _aobjfreelist
word _atomic_in_use
page_hash_table _changed_pages
word _composite_in_use
struct HeapSect _heap_sects
word _heapsize
ptr_t _last_heap_addr
mark_proc _mark_procs
word _max_heapsize
word _mem_freed
char _modws_valid_offsets
word _non_gc_bytes_at_gc
ptr_t _obj_map
ptr_t _objfreelist
page_hash_table _prev_changed_pages
ptr_t _prev_heap_addr
struct roots * _root_index
unsigned _size_map
ptr_t _sobjfreelist
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 1110 of file gc_priv.h.

Class Members
word hs_bytes
ptr_t hs_start
struct obj_kind

Definition at line 1195 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 646 of file gc_priv.h.

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

Definition at line 1291 of file gc_priv.h.

#define ADD_SLOP (   bytes)    (bytes)

Definition at line 781 of file gc_priv.h.

Definition at line 778 of file gc_priv.h.

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

Definition at line 334 of file gc_priv.h.

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

Definition at line 1189 of file gc_priv.h.

Definition at line 822 of file gc_priv.h.

Definition at line 204 of file gc_priv.h.

Definition at line 876 of file gc_priv.h.

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

Definition at line 689 of file gc_priv.h.

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

Definition at line 669 of file gc_priv.h.

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

Definition at line 335 of file gc_priv.h.

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

Definition at line 1316 of file gc_priv.h.

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

Definition at line 808 of file gc_priv.h.

#define CLOCK_TYPE   clock_t

Definition at line 302 of file gc_priv.h.

#define CLOCKS_PER_SEC   1000000

Definition at line 290 of file gc_priv.h.

Definition at line 73 of file gc_priv.h.

Definition at line 735 of file gc_priv.h.

Definition at line 706 of file gc_priv.h.

Definition at line 1068 of file gc_priv.h.

Definition at line 743 of file gc_priv.h.

Definition at line 575 of file gc_priv.h.

Definition at line 604 of file gc_priv.h.

Definition at line 869 of file gc_priv.h.

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

Definition at line 746 of file gc_priv.h.

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

Definition at line 691 of file gc_priv.h.

Definition at line 606 of file gc_priv.h.

Value:

Definition at line 1213 of file gc_priv.h.

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

Definition at line 1190 of file gc_priv.h.

Definition at line 1211 of file gc_priv.h.

Definition at line 570 of file gc_priv.h.

#define EXACT_FIRST   /* Make a complete pass through the large object */

Definition at line 175 of file gc_priv.h.

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

Definition at line 654 of file gc_priv.h.

Definition at line 571 of file gc_priv.h.

#define FALSE   0

Definition at line 54 of file gc_priv.h.

#define FASTLOCK ( )    LOCK()

Definition at line 578 of file gc_priv.h.

Definition at line 579 of file gc_priv.h.

#define FASTUNLOCK ( )    UNLOCK()

Definition at line 580 of file gc_priv.h.

Definition at line 153 of file gc_priv.h.

Definition at line 1453 of file gc_priv.h.

#define GC_all_nils   GC_arrays._all_nils

Definition at line 1170 of file gc_priv.h.

#define GC_aobjfreelist   GC_arrays._aobjfreelist

Definition at line 1138 of file gc_priv.h.

#define GC_atomic_in_use   GC_arrays._atomic_in_use

Definition at line 1183 of file gc_priv.h.

#define GC_changed_pages   GC_arrays._changed_pages

Definition at line 1147 of file gc_priv.h.

#define GC_composite_in_use   GC_arrays._composite_in_use

Definition at line 1182 of file gc_priv.h.

Definition at line 1691 of file gc_priv.h.

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

Definition at line 1692 of file gc_priv.h.

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

Definition at line 1693 of file gc_priv.h.

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

Definition at line 1694 of file gc_priv.h.

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

Definition at line 1696 of file gc_priv.h.

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

Definition at line 1698 of file gc_priv.h.

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

Definition at line 1701 of file gc_priv.h.

#define GC_excl_table   GC_arrays._excl_table

Definition at line 1169 of file gc_priv.h.

Definition at line 79 of file gc_priv.h.

Definition at line 1546 of file gc_priv.h.

#define GC_heap_sects   GC_arrays._heap_sects

Definition at line 1162 of file gc_priv.h.

#define GC_heapsize   GC_arrays._heapsize

Definition at line 1159 of file gc_priv.h.

Definition at line 159 of file gc_priv.h.

#define GC_last_heap_addr   GC_arrays._last_heap_addr

Definition at line 1151 of file gc_priv.h.

#define GC_last_stack   GC_arrays._last_stack

Definition at line 1163 of file gc_priv.h.

#define GC_mark_procs   GC_arrays._mark_procs

Definition at line 1158 of file gc_priv.h.

#define GC_max_heapsize   GC_arrays._max_heapsize

Definition at line 1160 of file gc_priv.h.

#define GC_mem_freed   GC_arrays._mem_freed

Definition at line 1157 of file gc_priv.h.

#define GC_modws_valid_offsets   GC_arrays._modws_valid_offsets

Definition at line 1145 of file gc_priv.h.

#define GC_non_gc_bytes_at_gc   GC_arrays._non_gc_bytes_at_gc

Definition at line 1156 of file gc_priv.h.

#define GC_obj_map   GC_arrays._obj_map

Definition at line 1150 of file gc_priv.h.

#define GC_objfreelist   GC_arrays._objfreelist

Definition at line 1137 of file gc_priv.h.

#define GC_prev_changed_pages   GC_arrays._prev_changed_pages

Definition at line 1148 of file gc_priv.h.

#define GC_prev_heap_addr   GC_arrays._prev_heap_addr

Definition at line 1152 of file gc_priv.h.

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

Definition at line 1679 of file gc_priv.h.

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

Definition at line 1680 of file gc_priv.h.

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

Definition at line 1681 of file gc_priv.h.

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

Definition at line 1682 of file gc_priv.h.

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

Definition at line 1683 of file gc_priv.h.

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

Definition at line 1685 of file gc_priv.h.

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

Definition at line 1687 of file gc_priv.h.

#define GC_root_index   GC_arrays._root_index

Definition at line 1168 of file gc_priv.h.

#define GC_size_map   GC_arrays._size_map

Definition at line 1186 of file gc_priv.h.

#define GC_sobjfreelist   GC_arrays._sobjfreelist

Definition at line 1143 of file gc_priv.h.

#define GC_static_roots   GC_arrays._static_roots

Definition at line 1167 of file gc_priv.h.

#define GC_top_index   GC_arrays._top_index

Definition at line 1171 of file gc_priv.h.

#define GC_uobjfreelist   GC_arrays._uobjfreelist

Definition at line 1139 of file gc_priv.h.

#define GC_valid_offsets   GC_arrays._valid_offsets

Definition at line 1144 of file gc_priv.h.

#define GC_words_allocd   GC_arrays._words_allocd

Definition at line 1153 of file gc_priv.h.

#define GC_words_allocd_before_gc   GC_arrays._words_allocd_before_gc

Definition at line 1161 of file gc_priv.h.

#define GC_words_finalized   GC_arrays._words_finalized

Definition at line 1155 of file gc_priv.h.

#define GC_words_wasted   GC_arrays._words_wasted

Definition at line 1154 of file gc_priv.h.

#define GET_MEM (   bytes)    (struct hblk *)GC_unix_get_mem(bytes)

Definition at line 381 of file gc_priv.h.

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

Definition at line 804 of file gc_priv.h.

#define GET_TIME (   x)    x = clock()

Definition at line 303 of file gc_priv.h.

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

Definition at line 748 of file gc_priv.h.

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

Definition at line 760 of file gc_priv.h.

Definition at line 820 of file gc_priv.h.

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

Definition at line 758 of file gc_priv.h.

Definition at line 737 of file gc_priv.h.

Definition at line 886 of file gc_priv.h.

Definition at line 885 of file gc_priv.h.

#define I_HOLD_LOCK ( )    FALSE

Definition at line 565 of file gc_priv.h.

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

Definition at line 854 of file gc_priv.h.

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

Definition at line 1226 of file gc_priv.h.

#define LOCK ( )

Definition at line 559 of file gc_priv.h.

Definition at line 736 of file gc_priv.h.

Definition at line 901 of file gc_priv.h.

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

Definition at line 794 of file gc_priv.h.

Definition at line 951 of file gc_priv.h.

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

Definition at line 670 of file gc_priv.h.

Definition at line 1066 of file gc_priv.h.

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

Definition at line 1064 of file gc_priv.h.

#define map_entry_type   char

Definition at line 1062 of file gc_priv.h.

Definition at line 1067 of file gc_priv.h.

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

Definition at line 1311 of file gc_priv.h.

Definition at line 824 of file gc_priv.h.

Definition at line 833 of file gc_priv.h.

Definition at line 924 of file gc_priv.h.

Definition at line 1108 of file gc_priv.h.

Definition at line 902 of file gc_priv.h.

Definition at line 1069 of file gc_priv.h.

Definition at line 919 of file gc_priv.h.

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

Definition at line 195 of file gc_priv.h.

#define MAXOBJKINDS   16

Definition at line 1193 of file gc_priv.h.

Definition at line 744 of file gc_priv.h.

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

Definition at line 162 of file gc_priv.h.

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

Definition at line 193 of file gc_priv.h.

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

Definition at line 756 of file gc_priv.h.

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

Definition at line 671 of file gc_priv.h.

#define MS_TIME_DIFF (   a,
  b 
)
Value:
((unsigned long) \
              (1000.0*(double)((a)-(b))/(double)CLOCKS_PER_SEC))

Definition at line 304 of file gc_priv.h.

#define NORMAL   1

Definition at line 1218 of file gc_priv.h.

#define OBJ_INVALID   0x7f

Definition at line 1063 of file gc_priv.h.

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

Definition at line 894 of file gc_priv.h.

Definition at line 888 of file gc_priv.h.

#define OFFSET_VALID (   displ)    GC_valid_offsets[displ]

Definition at line 1077 of file gc_priv.h.

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

Definition at line 690 of file gc_priv.h.

Definition at line 798 of file gc_priv.h.

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

Definition at line 802 of file gc_priv.h.

Definition at line 799 of file gc_priv.h.

#define PRESERVE_LAST   /* Do not divide last allocated heap segment */

Definition at line 177 of file gc_priv.h.

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

Definition at line 133 of file gc_priv.h.

#define PRINTSTATS   /* Print garbage collection statistics */

Definition at line 127 of file gc_priv.h.

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

Definition at line 130 of file gc_priv.h.

#define PTRFREE   0

Definition at line 1217 of file gc_priv.h.

Definition at line 773 of file gc_priv.h.

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

Definition at line 952 of file gc_priv.h.

Definition at line 563 of file gc_priv.h.

#define set_mark_bit_from_hdr (   hhdr,
  n 
)
Value:
(hhdr)->hb_marks[divWORDSZ(n)] \
                            |= (word)1 << modWORDSZ(n)

Definition at line 1313 of file gc_priv.h.

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

Definition at line 806 of file gc_priv.h.

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

Definition at line 688 of file gc_priv.h.

Definition at line 780 of file gc_priv.h.

Definition at line 634 of file gc_priv.h.

Definition at line 633 of file gc_priv.h.

#define STUBBORN   3

Definition at line 1225 of file gc_priv.h.

#define STUBBORN_ALLOC   /* Define stubborn allocation primitives */

Definition at line 95 of file gc_priv.h.

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

Definition at line 201 of file gc_priv.h.

#define TRUE   1

Definition at line 53 of file gc_priv.h.

Definition at line 673 of file gc_priv.h.

Definition at line 1219 of file gc_priv.h.

#define UNLOCK ( )

Definition at line 560 of file gc_priv.h.

Definition at line 564 of file gc_priv.h.

Value:

Definition at line 1070 of file gc_priv.h.

Definition at line 72 of file gc_priv.h.

#define WARN (   msg,
  arg 
)    (*GC_current_warn_proc)(msg, (GC_word)(arg))

Definition at line 658 of file gc_priv.h.

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

Definition at line 668 of file gc_priv.h.

Definition at line 687 of file gc_priv.h.


Typedef Documentation

typedef int GC_bool

Definition at line 52 of file gc_priv.h.

typedef struct ms_entry*(* mark_proc)()

Definition at line 899 of file gc_priv.h.

Definition at line 800 of file gc_priv.h.

typedef char* ptr_t

Definition at line 56 of file gc_priv.h.

Definition at line 42 of file gc_priv.h.

typedef GC_word word

Definition at line 41 of file gc_priv.h.


Function Documentation

Here is the caller graph for this function:

struct hblk* GC_allochblk ( ) [read]

Here is the caller graph for this function:

Definition at line 337 of file mark_rts.c.

{
    word dummy;
    
    return((ptr_t)(&dummy));
}

Here is the caller graph for this function:

Definition at line 82 of file blacklst.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 265 of file stubborn.c.

{
    register GC_PTR * p = GC_changing_list_start;
    register GC_PTR q;
    register ptr_t r;
    register unsigned long count = 0;
    register unsigned long dropped_count = 0;
    
    if (p == 0) /* initializing */ return;
    for (; p <= GC_changing_list_current; p++) {
        if ((q = *p) != 0) {
            count++;
            r = (ptr_t)GC_base(q);
            if (r == 0 || !GC_is_marked(r)) {
                *p = 0;
                dropped_count++;
           }
        }
    }
#   ifdef PRINTSTATS
      if (count > 0) {
        GC_printf2("%lu entries in changing list: reclaimed %lu\n",
                  (unsigned long)count, (unsigned long)dropped_count);
      }
#   endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 196 of file mark.c.

{
    GC_apply_to_all_blocks(clear_marks_for_block, (word)0);
    GC_objects_are_marked = FALSE;
    GC_mark_state = MS_INVALID;
    scan_ptr = 0;
#   ifdef GATHERSTATS
       /* Counters reflect currently marked objects: reset here */
        GC_composite_in_use = 0;
        GC_atomic_in_use = 0;
#   endif

}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 1329 of file os_dep.c.

Here is the caller graph for this function:

Definition at line 306 of file os_dep.c.

{
    if (!mask_initialized) {
       SIG_FILL(new_mask);

       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;
    }
#   ifdef CHECK_SIGNALS
       if (GC_sig_disabled != 0) ABORT("Nested disables");
       GC_sig_disabled++;
#   endif
    SIGSETMASK(old_mask,new_mask);
}

Definition at line 968 of file misc.c.

{
    GC_printf0("***Static roots:\n");
    GC_print_static_roots();
    GC_printf0("\n***Heap sections:\n");
    GC_print_heap_sects();
    GC_printf0("\n***Free blocks:\n");
    GC_print_hblkfreelist();
    GC_printf0("\n***Blocks in use:\n");
    GC_print_block_list();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 335 of file os_dep.c.

{
#   ifdef CHECK_SIGNALS
       if (GC_sig_disabled != 1) ABORT("Unmatched enable");
       GC_sig_disabled--;
#   endif
    SIGSETMASK(dummy,old_mask);
}

Here is the caller graph for this function:

Definition at line 466 of file finalize.c.

{
    struct disappearing_link * curr_dl, * prev_dl, * next_dl;
    struct finalizable_object * curr_fo, * prev_fo, * next_fo;
    ptr_t real_ptr, real_link;
    register int i;
    int dl_size = (log_dl_table_size == -1 ) ? 0 : (1 << log_dl_table_size);
    int fo_size = (log_fo_table_size == -1 ) ? 0 : (1 << log_fo_table_size);
    
  /* Make disappearing links disappear */
    for (i = 0; i < dl_size; i++) {
      curr_dl = dl_head[i];
      prev_dl = 0;
      while (curr_dl != 0) {
        real_ptr = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_obj);
        real_link = (ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link);
        if (!GC_is_marked(real_ptr)) {
            *(word *)real_link = 0;
            next_dl = dl_next(curr_dl);
            if (prev_dl == 0) {
                dl_head[i] = next_dl;
            } else {
                dl_set_next(prev_dl, next_dl);
            }
            GC_clear_mark_bit((ptr_t)curr_dl);
            GC_dl_entries--;
            curr_dl = next_dl;
        } else {
            prev_dl = curr_dl;
            curr_dl = dl_next(curr_dl);
        }
      }
    }
  /* Mark all objects reachable via chains of 1 or more pointers      */
  /* from finalizable objects.                                        */
#   ifdef PRINTSTATS
        if (GC_mark_state != MS_NONE) ABORT("Bad mark state");
#   endif
    for (i = 0; i < fo_size; i++) {
      for (curr_fo = fo_head[i]; curr_fo != 0; curr_fo = fo_next(curr_fo)) {
        real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base);
        if (!GC_is_marked(real_ptr)) {
            GC_MARK_FO(real_ptr, curr_fo -> fo_mark_proc);
            if (GC_is_marked(real_ptr)) {
                WARN("Finalization cycle involving %lx\n", real_ptr);
            }
        }
      }
    }
  /* Enqueue for finalization all objects that are still              */
  /* unreachable.                                              */
    GC_words_finalized = 0;
    for (i = 0; i < fo_size; i++) {
      curr_fo = fo_head[i];
      prev_fo = 0;
      while (curr_fo != 0) {
        real_ptr = (ptr_t)REVEAL_POINTER(curr_fo -> fo_hidden_base);
        if (!GC_is_marked(real_ptr)) {
#         ifndef JAVA_FINALIZATION
            GC_set_mark_bit(real_ptr);
#         endif
            /* Delete from hash table */
              next_fo = fo_next(curr_fo);
              if (prev_fo == 0) {
                fo_head[i] = next_fo;
              } else {
                fo_set_next(prev_fo, next_fo);
              }
              GC_fo_entries--;
            /* Add to list of objects awaiting finalization.   */
              fo_set_next(curr_fo, GC_finalize_now);
              GC_finalize_now = curr_fo;
              /* unhide object pointer so any future collections will */
              /* see it.                                       */
              curr_fo -> fo_hidden_base = 
                            (word) REVEAL_POINTER(curr_fo -> fo_hidden_base);
              GC_words_finalized +=
                     ALIGNED_WORDS(curr_fo -> fo_object_size)
                            + ALIGNED_WORDS(sizeof(struct finalizable_object));
#          ifdef PRINTSTATS
              if (!GC_is_marked((ptr_t)curr_fo)) {
                ABORT("GC_finalize: found accessible unmarked object\n");
              }
#          endif
            curr_fo = next_fo;
        } else {
            prev_fo = curr_fo;
            curr_fo = fo_next(curr_fo);
        }
      }
    }

# ifdef JAVA_FINALIZATION
  /* make sure we mark everything reachable from objects finalized
     using the no_order mark_proc */
    for (curr_fo = GC_finalize_now; 
        curr_fo != NULL; curr_fo = fo_next(curr_fo)) {
       real_ptr = (ptr_t)curr_fo -> fo_hidden_base;
       if (!GC_is_marked(real_ptr)) {
           if (curr_fo -> fo_mark_proc == GC_null_finalize_mark_proc) {
               GC_MARK_FO(real_ptr, GC_normal_finalize_mark_proc);
           }
           GC_set_mark_bit(real_ptr);
       }
    }
# endif

  /* Remove dangling disappearing links. */
    for (i = 0; i < dl_size; i++) {
      curr_dl = dl_head[i];
      prev_dl = 0;
      while (curr_dl != 0) {
        real_link = GC_base((ptr_t)REVEAL_POINTER(curr_dl -> dl_hidden_link));
        if (real_link != 0 && !GC_is_marked(real_link)) {
            next_dl = dl_next(curr_dl);
            if (prev_dl == 0) {
                dl_head[i] = next_dl;
            } else {
                dl_set_next(prev_dl, next_dl);
            }
            GC_clear_mark_bit((ptr_t)curr_dl);
            GC_dl_entries--;
            curr_dl = next_dl;
        } else {
            prev_dl = curr_dl;
            curr_dl = dl_next(curr_dl);
        }
      }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 459 of file alloc.c.

{
#   ifdef PRINTTIMES
       CLOCK_TYPE start_time;
       CLOCK_TYPE finalize_time;
       CLOCK_TYPE done_time;
       
       GET_TIME(start_time);
       finalize_time = start_time;
#   endif

#   ifdef GATHERSTATS
        GC_mem_found = 0;
#   endif
#   ifdef FIND_LEAK
      /* Mark all objects on the free list.  All objects should be */
      /* marked when we're done.                           */
       {
         register word size;              /* current object size             */
         register ptr_t p;  /* pointer to current object       */
         register struct hblk * h; /* pointer to block containing *p */
         register hdr * hhdr;
         register int word_no;           /* "index" of *p in *q          */
         int kind;

         for (kind = 0; kind < GC_n_kinds; kind++) {
           for (size = 1; size <= MAXOBJSZ; size++) {
             for (p= GC_obj_kinds[kind].ok_freelist[size];
                  p != 0; p=obj_link(p)){
              h = HBLKPTR(p);
              hhdr = HDR(h);
              word_no = (((word *)p) - ((word *)h));
              set_mark_bit_from_hdr(hhdr, word_no);
             }
           }
         }
       }
      /* Check that everything is marked */
       GC_start_reclaim(TRUE);
#   else

      GC_finalize();
#     ifdef STUBBORN_ALLOC
        GC_clean_changing_list();
#     endif

#     ifdef PRINTTIMES
       GET_TIME(finalize_time);
#     endif

      /* Clear free list mark bits, in case they got accidentally marked   */
      /* Note: HBLKPTR(p) == pointer to head of block containing *p        */
      /* Also subtract memory remaining from GC_mem_found count.           */
      /* Note that composite objects on free list are cleared.             */
      /* Thus accidentally marking a free list is not a problem;  only     */
      /* objects on the list itself will be marked, and that's fixed here. */
      {
       register word size;         /* current object size             */
       register ptr_t p;    /* pointer to current object       */
       register struct hblk * h;   /* pointer to block containing *p */
       register hdr * hhdr;
       register int word_no;           /* "index" of *p in *q          */
       int kind;

       for (kind = 0; kind < GC_n_kinds; kind++) {
         for (size = 1; size <= MAXOBJSZ; size++) {
           for (p= GC_obj_kinds[kind].ok_freelist[size];
                p != 0; p=obj_link(p)){
              h = HBLKPTR(p);
              hhdr = HDR(h);
              word_no = (((word *)p) - ((word *)h));
              clear_mark_bit_from_hdr(hhdr, word_no);
#             ifdef GATHERSTATS
                  GC_mem_found -= size;
#             endif
           }
         }
       }
      }


#     ifdef PRINTSTATS
       GC_printf1("Bytes recovered before sweep - f.l. count = %ld\n",
                 (long)WORDS_TO_BYTES(GC_mem_found));
#     endif

    /* Reconstruct free lists to contain everything not marked */
      GC_start_reclaim(FALSE);
    
#   endif /* !FIND_LEAK */

#   ifdef PRINTSTATS
       GC_printf2(
                "Immediately reclaimed %ld bytes in heap of size %lu bytes\n",
                 (long)WORDS_TO_BYTES(GC_mem_found),
                 (unsigned long)GC_heapsize);
       GC_printf2("%lu (atomic) + %lu (composite) collectable bytes in use\n",
                  (unsigned long)WORDS_TO_BYTES(GC_atomic_in_use),
                  (unsigned long)WORDS_TO_BYTES(GC_composite_in_use));
#   endif

      GC_n_attempts = 0;
    /* Reset or increment counters for next cycle */
      GC_words_allocd_before_gc += GC_words_allocd;
      GC_non_gc_bytes_at_gc = GC_non_gc_bytes;
      GC_words_allocd = 0;
      GC_words_wasted = 0;
      GC_mem_freed = 0;
      
#   ifdef PRINTTIMES
       GET_TIME(done_time);
       GC_printf2("Finalize + initiate sweep took %lu + %lu msecs\n",
                  MS_TIME_DIFF(finalize_time,start_time),
                  MS_TIME_DIFF(done_time,finalize_time));
#   endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 586 of file os_dep.c.

{
    word dummy;
    ptr_t result;

#   define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)

#   ifdef STACKBOTTOM
       return(STACKBOTTOM);
#   else
#      ifdef HEURISTIC1
#         ifdef STACK_GROWS_DOWN
            result = (ptr_t)((((word)(&dummy))
                            + STACKBOTTOM_ALIGNMENT_M1)
                           & ~STACKBOTTOM_ALIGNMENT_M1);
#         else
            result = (ptr_t)(((word)(&dummy))
                           & ~STACKBOTTOM_ALIGNMENT_M1);
#         endif
#      endif /* HEURISTIC1 */
#      ifdef HEURISTIC2
#          ifdef STACK_GROWS_DOWN
              result = GC_find_limit((ptr_t)(&dummy), TRUE);
#             ifdef HEURISTIC2_LIMIT
                  if (result > HEURISTIC2_LIMIT
                      && (ptr_t)(&dummy) < HEURISTIC2_LIMIT) {
                          result = HEURISTIC2_LIMIT;
                  }
#              endif
#          else
              result = GC_find_limit((ptr_t)(&dummy), FALSE);
#             ifdef HEURISTIC2_LIMIT
                  if (result < HEURISTIC2_LIMIT
                      && (ptr_t)(&dummy) > HEURISTIC2_LIMIT) {
                          result = HEURISTIC2_LIMIT;
                  }
#              endif
#          endif

#      endif /* HEURISTIC2 */
#      ifdef STACK_GROWS_DOWN
           if (result == 0) result = (ptr_t)(signed_word)(-sizeof(ptr_t));
#      endif
       return(result);
#   endif /* STACKBOTTOM */
}

Here is the caller graph for this function:

Definition at line 396 of file misc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 126 of file headers.c.

{
    register unsigned i;
    
    GC_all_nils = (bottom_index *)GC_scratch_alloc((word)sizeof(bottom_index));
    BZERO(GC_all_nils, sizeof(bottom_index));
    for (i = 0; i < TOP_SZ; i++) {
        GC_top_index[i] = GC_all_nils;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 418 of file misc.c.

{
#   ifndef THREADS
        word dummy;
#   endif
    
    if (GC_is_initialized) return;
    GC_setpagesize();
    GC_exclude_static_roots(beginGC_arrays, end_gc_area);
#   ifdef PRINTSTATS
       if ((ptr_t)endGC_arrays != (ptr_t)(&GC_obj_kinds)) {
           GC_printf0("Reordering linker, didn't exclude obj_kinds\n");
       }
#   endif
#   ifdef MACOS
    GC_init_MacOS();
#   endif
#   ifdef MSWIN32
       GC_init_win32();
#   endif
#   if defined(LINUX) && defined(POWERPC)
       GC_init_linuxppc();
#   endif
#   if defined(LINUX) && defined(SPARC)
       GC_init_linuxsparc();
#   endif
#   ifdef SOLARIS_THREADS
       GC_thr_init();
       /* We need dirty bits in order to find live stack sections.    */
        GC_dirty_init();
#   endif
#   if defined(IRIX_THREADS) || defined(LINUX_THREADS) \
       || defined(IRIX_JDK_THREADS)
        GC_thr_init();
#   endif
#   if !defined(THREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
       || defined(IRIX_THREADS) || defined(LINUX_THREADS) || defined(GENERIC_THREADS)
      if (GC_stackbottom == 0) {
       GC_stackbottom = GC_get_stack_base();
      }
#   endif
    if  (sizeof (ptr_t) != sizeof(word)) {
        ABORT("sizeof (ptr_t) != sizeof(word)\n");
    }
    if  (sizeof (signed_word) != sizeof(word)) {
        ABORT("sizeof (signed_word) != sizeof(word)\n");
    }
    if  (sizeof (struct hblk) != HBLKSIZE) {
        ABORT("sizeof (struct hblk) != HBLKSIZE\n");
    }
#   ifndef THREADS
#     if defined(STACK_GROWS_UP) && defined(STACK_GROWS_DOWN)
       ABORT(
         "Only one of STACK_GROWS_UP and STACK_GROWS_DOWN should be defd\n");
#     endif
#     if !defined(STACK_GROWS_UP) && !defined(STACK_GROWS_DOWN)
       ABORT(
         "One of STACK_GROWS_UP and STACK_GROWS_DOWN should be defd\n");
#     endif
#     ifdef STACK_GROWS_DOWN
        if ((word)(&dummy) > (word)GC_stackbottom) {
          GC_err_printf0(
              "STACK_GROWS_DOWN is defd, but stack appears to grow up\n");
#        ifndef UTS4  /* Compiler bug workaround */
            GC_err_printf2("sp = 0x%lx, GC_stackbottom = 0x%lx\n",
                        (unsigned long) (&dummy),
                        (unsigned long) GC_stackbottom);
#        endif
          ABORT("stack direction 3\n");
        }
#     else
        if ((word)(&dummy) < (word)GC_stackbottom) {
          GC_err_printf0(
              "STACK_GROWS_UP is defd, but stack appears to grow down\n");
          GC_err_printf2("sp = 0x%lx, GC_stackbottom = 0x%lx\n",
                             (unsigned long) (&dummy),
                      (unsigned long) GC_stackbottom);
          ABORT("stack direction 4");
        }
#     endif
#   endif
#   if !defined(_AUX_SOURCE) || defined(__GNUC__)
      if ((word)(-1) < (word)0) {
       GC_err_printf0("The type word should be an unsigned integer type\n");
       GC_err_printf0("It appears to be signed\n");
       ABORT("word");
      }
#   endif
    if ((signed_word)(-1) >= (signed_word)0) {
       GC_err_printf0(
              "The type signed_word should be a signed integer type\n");
       GC_err_printf0("It appears to be unsigned\n");
       ABORT("signed_word");
    }
    
    /* Add initial guess of root sets.  Do this first, since sbrk(0)  */
    /* might be used.                                                 */
      GC_register_data_segments();
    GC_init_headers();
    GC_bl_init();
    GC_mark_init();
    if (!GC_expand_hp_inner((word)MINHINCR)) {
        GC_err_printf0("Can't start up: not enough memory\n");
        EXIT();
    }
    /* Preallocate large object map.  It's otherwise inconvenient to  */
    /* deal with failure.                                      */
      if (!GC_add_map_entry((word)0)) {
        GC_err_printf0("Can't start up: not enough memory\n");
        EXIT();
      }
    GC_register_displacement_inner(0L);
#   ifdef MERGE_SIZES
      GC_init_size_map();
#   endif
#   ifdef PCR
      if (PCR_IL_Lock(PCR_Bool_false, PCR_allSigsBlocked, PCR_waitForever)
          != PCR_ERes_okay) {
          ABORT("Can't lock load state\n");
      } else if (PCR_IL_Unlock() != PCR_ERes_okay) {
          ABORT("Can't unlock load state\n");
      }
      PCR_IL_Unlock();
      GC_pcr_install();
#   endif
    /* Get black list set up */
      GC_gcollect_inner();
#   ifdef STUBBORN_ALLOC
       GC_stubborn_init();
#   endif
    GC_is_initialized = TRUE;
    /* Convince lint that some things are used */
#   ifdef LINT
      {
          extern char * GC_copyright[];
          extern int GC_read();
          extern void GC_register_finalizer_no_order();
          
          GC_noop(GC_copyright, GC_find_header,
                  GC_push_one, GC_call_with_alloc_lock, GC_read,
                  GC_dont_expand,
#               ifndef NO_DEBUGGING
                  GC_dump,
#               endif
                  GC_register_finalizer_no_order);
      }
#   endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 213 of file mark.c.

{
    if (GC_dirty_maintained) GC_read_dirty();
#   ifdef STUBBORN_ALLOC
       GC_read_changed();
#   endif
#   ifdef CHECKSUMS
       {
           extern void GC_check_dirty();
           
           if (GC_dirty_maintained) GC_check_dirty();
       }
#   endif
#   ifdef GATHERSTATS
       GC_n_rescuing_pages = 0;
#   endif
    if (GC_mark_state == MS_NONE) {
        GC_mark_state = MS_PUSH_RESCUERS;
    } else if (GC_mark_state != MS_INVALID) {
       ABORT("unexpected state");
    } /* else this is really a full collection, and mark       */
      /* bits are invalid.                              */
    scan_ptr = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 397 of file mark.c.

Here is the caller graph for this function:

struct hblk* GC_is_black_listed ( ) [read]

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 424 of file mark.c.

{
  mse * GC_mark_stack_reg = GC_mark_stack;
  mse * GC_mark_stack_top_reg = GC_mark_stack_top;
  mse * mark_stack_limit = &(GC_mark_stack[GC_mark_stack_size]);
  int credit = HBLKSIZE;    /* Remaining credit for marking work      */
  register word * current_p;       /* Pointer to current candidate ptr.      */
  register word current;    /* Candidate pointer.                     */
  register word * limit;    /* (Incl) limit of current candidate      */
                            /* range                           */
  register word descr;
  register ptr_t greatest_ha = GC_greatest_plausible_heap_addr;
  register ptr_t least_ha = GC_least_plausible_heap_addr;
# define SPLIT_RANGE_WORDS 128  /* Must be power of 2.         */

  GC_objects_are_marked = TRUE;
# if defined(OS2) /* Use untweaked version to circumvent compiler problem */
  while (GC_mark_stack_top_reg >= GC_mark_stack_reg && credit >= 0) {
# else
  while ((((ptr_t)GC_mark_stack_top_reg - (ptr_t)GC_mark_stack_reg) | credit)
       >= 0) {
# endif
    current_p = GC_mark_stack_top_reg -> mse_start;
  retry:
    descr = GC_mark_stack_top_reg -> mse_descr;
    if (descr & ((~(WORDS_TO_BYTES(SPLIT_RANGE_WORDS) - 1)) | DS_TAGS)) {
      word tag = descr & DS_TAGS;
      
      switch(tag) {
        case DS_LENGTH:
          /* Large length.                                      */
          /* Process part of the range to avoid pushing too much on the      */
          /* stack.                                            */
          GC_mark_stack_top_reg -> mse_start =
              limit = current_p + SPLIT_RANGE_WORDS-1;
          GC_mark_stack_top_reg -> mse_descr -=
                     WORDS_TO_BYTES(SPLIT_RANGE_WORDS-1);
          /* Make sure that pointers overlapping the two ranges are   */
          /* considered.                                       */
          limit = (word *)((char *)limit + sizeof(word) - ALIGNMENT);
          break;
        case DS_BITMAP:
          GC_mark_stack_top_reg--;
          descr &= ~DS_TAGS;
          credit -= WORDS_TO_BYTES(WORDSZ/2); /* guess */
          while (descr != 0) {
            if ((signed_word)descr < 0) {
              current = *current_p;
             if ((ptr_t)current >= least_ha && (ptr_t)current < greatest_ha) {
                PUSH_CONTENTS(current, GC_mark_stack_top_reg, mark_stack_limit,
                           current_p, exit1);
             }
            }
           descr <<= 1;
           ++ current_p;
          }
          continue;
        case DS_PROC:
          GC_mark_stack_top_reg--;
          credit -= PROC_BYTES;
          GC_mark_stack_top_reg =
              (*PROC(descr))
                         (current_p, GC_mark_stack_top_reg,
                         mark_stack_limit, ENV(descr));
          continue;
        case DS_PER_OBJECT:
          GC_mark_stack_top_reg -> mse_descr =
                     *(word *)((ptr_t)current_p + descr - tag);
          goto retry;
      }
    } else {
      GC_mark_stack_top_reg--;
      limit = (word *)(((ptr_t)current_p) + (word)descr);
    }
    /* The simple case in which we're scanning a range. */
    credit -= (ptr_t)limit - (ptr_t)current_p;
    limit -= 1;
    while (current_p <= limit) {
      current = *current_p;
      if ((ptr_t)current >= least_ha && (ptr_t)current <  greatest_ha) {
        PUSH_CONTENTS(current, GC_mark_stack_top_reg,
                    mark_stack_limit, current_p, exit2);
      }
      current_p = (word *)((char *)current_p + ALIGNMENT);
    }
  }
  GC_mark_stack_top = GC_mark_stack_top_reg;
}

Here is the caller graph for this function:

Definition at line 556 of file mark.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 339 of file mark.c.

Here is the caller graph for this function:

Here is the caller graph for this function:

struct hblk* GC_next_block ( ) [read]

Here is the caller graph for this function:

Definition at line 27 of file mark.c.

{}

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 619 of file reclaim.c.

{
    GC_printf0("(kind(0=ptrfree,1=normal,2=unc.,3=stubborn):size_in_bytes, #_marks_set)\n");
    number_of_blocks = 0;
    total_bytes = 0;
    GC_apply_to_all_blocks(GC_print_block_descr, (word)0);
    GC_printf2("\nblocks = %lu, bytes = %lu\n",
              (unsigned long)number_of_blocks,
              (unsigned long)total_bytes);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 47 of file allchblk.c.

{
    struct hblk * h = GC_hblkfreelist;
    word total_free = 0;
    hdr * hhdr = HDR(h);
    word sz;
    
    while (h != 0) {
        sz = hhdr -> hb_sz;
       GC_printf2("0x%lx size %lu ", (unsigned long)h, (unsigned long)sz);
       total_free += sz;
        if (GC_is_black_listed(h, HBLKSIZE) != 0) {
             GC_printf0("start black listed\n");
        } else if (GC_is_black_listed(h, hhdr -> hb_sz) != 0) {
             GC_printf0("partially black listed\n");
        } else {
             GC_printf0("not black listed\n");
        }
        h = hhdr -> hb_next;
        hhdr = HDR(h);
    }
    GC_printf1("Total of %lu bytes on free list\n", (unsigned long)total_free);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 671 of file alloc.c.

{
    register unsigned i;
    
    GC_printf1("Total heap size: %lu\n", (unsigned long) GC_heapsize);
    for (i = 0; i < GC_n_heap_sects; i++) {
        unsigned long start = (unsigned long) GC_heap_sects[i].hs_start;
        unsigned long len = (unsigned long) GC_heap_sects[i].hs_bytes;
        struct hblk *h;
        unsigned nbl = 0;
        
       GC_printf3("Section %ld from 0x%lx to 0x%lx ", (unsigned long)i,
                 start, (unsigned long)(start + len));
       for (h = (struct hblk *)start; h < (struct hblk *)(start + len); h++) {
           if (GC_is_black_listed(h, HBLKSIZE)) nbl++;
       }
       GC_printf2("%lu/%lu blacklisted\n", (unsigned long)nbl,
                 (unsigned long)(len/HBLKSIZE));
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 42 of file mark_rts.c.

{
    register int i;
    size_t total = 0;
    
    for (i = 0; i < n_root_sets; i++) {
        GC_printf2("From 0x%lx to 0x%lx ",
                 (unsigned long) GC_static_roots[i].r_start,
                 (unsigned long) GC_static_roots[i].r_end);
        if (GC_static_roots[i].r_tmp) {
            GC_printf0(" (temporary)\n");
        } else {
            GC_printf0("\n");
        }
        total += GC_static_roots[i].r_end - GC_static_roots[i].r_start;
    }
    GC_printf1("Total size: %ld\n", (unsigned long) total);
    if (GC_root_size != total) {
       GC_printf1("GC_root_size incorrect: %ld!!\n",
                 (unsigned long) GC_root_size);
    }
}

Here is the caller graph for this function:

Definition at line 123 of file blacklst.c.

{
    word * very_old_normal_bl = GC_old_normal_bl;
    word * very_old_stack_bl = GC_old_stack_bl;
    
    GC_old_normal_bl = GC_incomplete_normal_bl;
    GC_old_stack_bl = GC_incomplete_stack_bl;
#   ifndef ALL_INTERIOR_POINTERS
      GC_clear_bl(very_old_normal_bl);
#   endif
    GC_clear_bl(very_old_stack_bl);
    GC_incomplete_normal_bl = very_old_normal_bl;
    GC_incomplete_stack_bl = very_old_stack_bl;
    GC_total_stack_black_listed = total_stack_black_listed();
#   ifdef PRINTSTATS
       GC_printf1("%ld bytes in heap blacklisted for interior pointers\n",
                 (unsigned long)GC_total_stack_black_listed);
#   endif
    if (GC_total_stack_black_listed != 0) {
        GC_black_list_spacing =
              HBLKSIZE*(GC_heapsize/GC_total_stack_black_listed);
    }
    if (GC_black_list_spacing < 3 * HBLKSIZE) {
       GC_black_list_spacing = 3 * HBLKSIZE;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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 )
ptr_t GC_generic_malloc_words_small GC_PROTO ( (size_t words, int kind)  )

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

struct hblk* GC_push_next_marked ( ) [read]

Here is the caller graph for this function:

struct hblk* GC_push_next_marked_dirty ( ) [read]

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 101 of file mach_dep.c.

{
#       ifdef RT
         register long TMP_SP; /* must be bound to r11 */
#       endif
#       ifdef VAX
         /* VAX - generic code below does not work under 4.2 */
         /* r1 through r5 are caller save, and therefore     */
         /* on the stack or dead.                            */
         asm("pushl r11");     asm("calls $1,_GC_push_one");
         asm("pushl r10");  asm("calls $1,_GC_push_one");
         asm("pushl r9");   asm("calls $1,_GC_push_one");
         asm("pushl r8");   asm("calls $1,_GC_push_one");
         asm("pushl r7");   asm("calls $1,_GC_push_one");
         asm("pushl r6");   asm("calls $1,_GC_push_one");
#       endif
#       if defined(M68K) && (defined(SUNOS4) || defined(NEXT))
       /*  M68K SUNOS - could be replaced by generic code */
         /* a0, a1 and d1 are caller save          */
         /*  and therefore are on stack or dead.   */
       
         asm("subqw #0x4,sp");            /* allocate word on top of stack */

         asm("movl a2,sp@");       asm("jbsr _GC_push_one");
         asm("movl a3,sp@");       asm("jbsr _GC_push_one");
         asm("movl a4,sp@");       asm("jbsr _GC_push_one");
         asm("movl a5,sp@");       asm("jbsr _GC_push_one");
         /* Skip frame pointer and stack pointer */
         asm("movl d1,sp@");       asm("jbsr _GC_push_one");
         asm("movl d2,sp@");       asm("jbsr _GC_push_one");
         asm("movl d3,sp@");       asm("jbsr _GC_push_one");
         asm("movl d4,sp@");       asm("jbsr _GC_push_one");
         asm("movl d5,sp@");       asm("jbsr _GC_push_one");
         asm("movl d6,sp@");       asm("jbsr _GC_push_one");
         asm("movl d7,sp@");       asm("jbsr _GC_push_one");

         asm("addqw #0x4,sp");            /* put stack back where it was     */
#       endif

#       if defined(M68K) && defined(HP)
       /*  M68K HP - could be replaced by generic code */
         /* a0, a1 and d1 are caller save.  */
       
         asm("subq.w &0x4,%sp");   /* allocate word on top of stack */

         asm("mov.l %a2,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %a3,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %a4,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %a5,(%sp)"); asm("jsr _GC_push_one");
         /* Skip frame pointer and stack pointer */
         asm("mov.l %d1,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d2,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d3,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d4,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d5,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d6,(%sp)"); asm("jsr _GC_push_one");
         asm("mov.l %d7,(%sp)"); asm("jsr _GC_push_one");

         asm("addq.w &0x4,%sp");   /* put stack back where it was     */
#       endif /* M68K HP */

#       ifdef AMIGA
       /*  AMIGA - could be replaced by generic code                  */
         /* a0, a1, d0 and d1 are caller save */
         GC_push_one(getreg(REG_A2));
         GC_push_one(getreg(REG_A3));
         GC_push_one(getreg(REG_A4));
         GC_push_one(getreg(REG_A5));
         GC_push_one(getreg(REG_A6));
         /* Skip stack pointer */
         GC_push_one(getreg(REG_D2));
         GC_push_one(getreg(REG_D3));
         GC_push_one(getreg(REG_D4));
         GC_push_one(getreg(REG_D5));
         GC_push_one(getreg(REG_D6));
         GC_push_one(getreg(REG_D7));
#       endif

#    if defined(MACOS)
#      if defined(M68K) && defined(THINK_C)
#         define PushMacReg(reg) \
              move.l  reg,(sp) \
              jsr             GC_push_one
                       asm {
                            sub.w   #4,sp                   ; reserve space for one parameter.
                            PushMacReg(a2);
                            PushMacReg(a3);
                            PushMacReg(a4);
                            ; skip a5 (globals), a6 (frame pointer), and a7 (stack pointer)
                            PushMacReg(d2);
                            PushMacReg(d3);
                            PushMacReg(d4);
                            PushMacReg(d5);
                            PushMacReg(d6);
                            PushMacReg(d7);
                            add.w   #4,sp                   ; fix stack.
                       }
#        undef PushMacReg
#        endif /* THINK_C && M68K */
#        if defined(__MWERKS__)
           PushMacRegisters();
#        endif       /* __MWERKS__ */
#   endif     /* MACOS */

#       if defined(I386) &&!defined(OS2) &&!defined(SVR4) &&!defined(MSWIN32) \
       && !defined(SCO) && !defined(SCO_ELF) \
       && !(defined(LINUX)       && defined(__ELF__)) \
       && !(defined(__FreeBSD__) && defined(__ELF__)) \
       && !defined(DOS4GW)
       /* I386 code, generic code does not appear to work */
       /* It does appear to work under OS2, and asms dont */
       /* This is used for some 38g UNIX variants and for CYGWIN32 */
         asm("pushl %eax");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ecx");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edx");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebp");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %esi");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edi");  asm("call _GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebx");  asm("call _GC_push_one"); asm("addl $4,%esp");
#       endif

#      if ( defined(I386) && defined(LINUX) && defined(__ELF__) ) \
       || ( defined(I386) && defined(__FreeBSD__) && defined(__ELF__) )

       /* This is modified for Linux with ELF (Note: _ELF_ only) */
       /* This section handles FreeBSD with ELF. */
         asm("pushl %eax");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ecx");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edx");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebp");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %esi");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edi");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebx");  asm("call GC_push_one"); asm("addl $4,%esp");
#      endif

#       if defined(I386) && defined(MSWIN32) && !defined(USE_GENERIC)
       /* I386 code, Microsoft variant           */
         __asm  push eax
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push ebx
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push ecx
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push edx
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push ebp
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push esi
         __asm  call GC_push_one
         __asm  add esp,4
         __asm  push edi
         __asm  call GC_push_one
         __asm  add esp,4
#       endif

#       if defined(I386) && (defined(SVR4) || defined(SCO) || defined(SCO_ELF))
       /* I386 code, SVR4 variant, generic code does not appear to work */
         asm("pushl %eax");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebx");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ecx");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edx");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %ebp");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %esi");  asm("call GC_push_one"); asm("addl $4,%esp");
         asm("pushl %edi");  asm("call GC_push_one"); asm("addl $4,%esp");
#       endif

#       ifdef NS32K
         asm ("movd r3, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
         asm ("movd r4, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
         asm ("movd r5, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
         asm ("movd r6, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
         asm ("movd r7, tos"); asm ("bsr ?_GC_push_one"); asm ("adjspb $-4");
#       endif

#       ifdef SPARC
         {
             word GC_save_regs_in_stack();
             
             /* generic code will not work */
             (void)GC_save_regs_in_stack();
         }
#       endif

#      ifdef RT
           GC_push_one(TMP_SP);    /* GC_push_one from r11 */

           asm("cas r11, r6, r0"); GC_push_one(TMP_SP); /* r6 */
           asm("cas r11, r7, r0"); GC_push_one(TMP_SP); /* through */
           asm("cas r11, r8, r0"); GC_push_one(TMP_SP); /* r10 */
           asm("cas r11, r9, r0"); GC_push_one(TMP_SP);
           asm("cas r11, r10, r0"); GC_push_one(TMP_SP);

           asm("cas r11, r12, r0"); GC_push_one(TMP_SP); /* r12 */
           asm("cas r11, r13, r0"); GC_push_one(TMP_SP); /* through */
           asm("cas r11, r14, r0"); GC_push_one(TMP_SP); /* r15 */
           asm("cas r11, r15, r0"); GC_push_one(TMP_SP);
#       endif

#       if defined(M68K) && defined(SYSV)
       /*  Once again similar to SUN and HP, though setjmp appears to work.
              --Parag
        */
#        ifdef __GNUC__
         asm("subqw #0x4,%sp");    /* allocate word on top of stack */
  
         asm("movl %a2,%sp@");     asm("jbsr GC_push_one");
         asm("movl %a3,%sp@");     asm("jbsr GC_push_one");
         asm("movl %a4,%sp@");     asm("jbsr GC_push_one");
         asm("movl %a5,%sp@");     asm("jbsr GC_push_one");
         /* Skip frame pointer and stack pointer */
         asm("movl %d1,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d2,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d3,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d4,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d5,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d6,%sp@");     asm("jbsr GC_push_one");
         asm("movl %d7,%sp@");     asm("jbsr GC_push_one");
  
         asm("addqw #0x4,%sp");    /* put stack back where it was     */
#        else /* !__GNUC__*/
         asm("subq.w &0x4,%sp");   /* allocate word on top of stack */
  
         asm("mov.l %a2,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %a3,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %a4,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %a5,(%sp)"); asm("jsr GC_push_one");
         /* Skip frame pointer and stack pointer */
         asm("mov.l %d1,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d2,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d3,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d4,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d5,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d6,(%sp)"); asm("jsr GC_push_one");
         asm("mov.l %d7,(%sp)"); asm("jsr GC_push_one");
  
         asm("addq.w &0x4,%sp");   /* put stack back where it was     */
#        endif /* !__GNUC__ */
#       endif /* M68K/SYSV */


      /* other machines... */
#       if !(defined M68K) && !(defined VAX) && !(defined RT) 
#      if !(defined SPARC) && !(defined I386) && !(defined NS32K)
#      if !defined(POWERPC) && !defined(UTS4)
           --> bad news <--
#       endif
#       endif
#       endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 235 of file stubborn.c.

{
    register GC_PTR * p = GC_changing_list_start;
    register GC_PTR q;
    register struct hblk * h;
    register word index;
    
    if (p == 0) /* initializing */ return;
    BCOPY(GC_changed_pages, GC_prev_changed_pages,
          (sizeof GC_changed_pages));
    BZERO(GC_changed_pages, (sizeof GC_changed_pages));
    for (; p <= GC_changing_list_current; p++) {
        if ((q = *p) != 0) {
            h = HBLKPTR(q);
            index = PHT_HASH(h);
            set_pht_entry_from_index(GC_changed_pages, index);
        }
    }
}

Here is the caller graph for this function:

Definition at line 1336 of file os_dep.c.

{}

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 935 of file os_dep.c.

{
#   if !defined(PCR) && !defined(SRC_M3) && !defined(NEXT) && !defined(MACOS)
#     if defined(REDIRECT_MALLOC) && defined(SOLARIS_THREADS)
       /* As of Solaris 2.3, the Solaris threads implementation       */
       /* allocates the data structure for the initial thread with    */
       /* sbrk at process startup.  It needs to be scanned, so that   */
       /* we don't lose some malloc allocated data structures         */
       /* hanging from it.  We're on thin ice here ...                */
        extern caddr_t sbrk();

       GC_add_roots_inner(DATASTART, (char *)sbrk(0), FALSE);
#     else
       GC_add_roots_inner(DATASTART, (char *)(DATAEND), FALSE);
#     endif
#   endif
#   if !defined(PCR) && defined(NEXT)
      GC_add_roots_inner(DATASTART, (char *) get_end(), FALSE);
#   endif
#   if defined(MACOS)
    {
#   if defined(THINK_C)
       extern void* GC_MacGetDataStart(void);
       /* globals begin above stack and end at a5. */
       GC_add_roots_inner((ptr_t)GC_MacGetDataStart(),
                        (ptr_t)LMGetCurrentA5(), FALSE);
#   else
#     if defined(__MWERKS__)
#       if !__POWERPC__
         extern void* GC_MacGetDataStart(void);
         /* MATTHEW: Function to handle Far Globals (CW Pro 3) */
#         if __option(far_data)
         extern void* GC_MacGetDataEnd(void);
#         endif
         /* globals begin above stack and end at a5. */
         GC_add_roots_inner((ptr_t)GC_MacGetDataStart(),
                          (ptr_t)LMGetCurrentA5(), FALSE);
         /* MATTHEW: Handle Far Globals */                          
#         if __option(far_data)
      /* Far globals follow he QD globals: */
         GC_add_roots_inner((ptr_t)LMGetCurrentA5(),
                          (ptr_t)GC_MacGetDataEnd(), FALSE);
#         endif
#       else
         extern char __data_start__[], __data_end__[];
         GC_add_roots_inner((ptr_t)&__data_start__,
                          (ptr_t)&__data_end__, FALSE);
#       endif /* __POWERPC__ */
#     endif /* __MWERKS__ */
#   endif /* !THINK_C */
    }
#   endif /* MACOS */

    /* Dynamic libraries are added at every collection, since they may  */
    /* change.                                                        */
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 869 of file dyn_load.c.

{}

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 204 of file alloc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 48 of file stubborn.c.

{
#   define INIT_SIZE 10

    GC_changing_list_start = (GC_PTR *)
                     GC_generic_malloc_inner(
                            (word)(INIT_SIZE * sizeof(GC_PTR)),
                            PTRFREE);
    BZERO(GC_changing_list_start,
         INIT_SIZE * sizeof(GC_PTR));
    if (GC_changing_list_start == 0) {
        GC_err_printf0("Insufficient space to start up\n");
        ABORT("GC_stubborn_init: put of space");
    }
    GC_changing_list_current = GC_changing_list_start;
    GC_changing_list_limit = GC_changing_list_start + INIT_SIZE - 1;
    * GC_changing_list_limit = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file blacklst.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 1135 of file gc_priv.h.

Definition at line 51 of file blacklst.c.

Definition at line 67 of file misc.c.

GC_warn_proc GC_current_warn_proc

Definition at line 744 of file misc.c.

Definition at line 64 of file misc.c.

Definition at line 1318 of file os_dep.c.

Definition at line 1231 of file gc_priv.h.

Definition at line 694 of file alloc.c.

Definition at line 40 of file allchblk.c.

Definition at line 62 of file alloc.c.

Definition at line 24 of file obj_map.c.

Definition at line 394 of file misc.c.

Definition at line 693 of file alloc.c.

Definition at line 608 of file alloc.c.

Definition at line 79 of file mark.c.

Definition at line 113 of file mark.c.

OS/2.

Definition at line 355 of file os_dep.c.

Definition at line 63 of file blacklst.c.

Definition at line 1170 of file os_dep.c.

Definition at line 149 of file mark_rts.c.

Definition at line 69 of file misc.c.

Definition at line 49 of file blacklst.c.