C:/Users/Dennis/src/lang/russell.orig/src/gc/alloc.c File Reference

#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include "gc_private.h"

Go to the source code of this file.

Defines

#define NWORDS   64

Functions

void GC_clear_hdr_marks (hdr *hhdr)
static void clear_marks_for_block (struct hblk *h, word dummy)
static void clear_marks ()
static word min_words_allocd ()
word GC_adj_words_allocd ()
void GC_clear_a_few_frames ()
bool GC_gcollect_inner (bool force)
void GC_gcollect ()
void GC_add_to_heap (struct hblk *p, word bytes)
ptr_t GC_max (ptr_t x, ptr_t y)
ptr_t GC_min (ptr_t x, ptr_t y)
bool GC_expand_hp_inner (word n)
int GC_expand_hp (int n)
void GC_collect_or_expand (word needed_blocks)
ptr_t GC_allocobj (word sz, int kind)

Variables

word GC_non_gc_bytes = 0
word GC_gc_no = 0
char * GC_copyright []
signed_word GC_mem_found
bool GC_dont_expand = 0
word GC_free_space_divisor = 4
ptr_t GC_least_plausible_heap_addr = (ptr_t)ONES
ptr_t GC_greatest_plausible_heap_addr = 0


Define Documentation

#define NWORDS   64

Referenced by GC_clear_a_few_frames().


Function Documentation

static void clear_marks (  )  [static]

Definition at line 112 of file alloc.c.

References clear_marks_for_block(), and GC_apply_to_all_blocks().

Referenced by GC_gcollect_inner().

static void clear_marks_for_block ( struct hblk h,
word  dummy 
) [static]

Definition at line 100 of file alloc.c.

References GC_clear_hdr_marks(), and HDR.

Referenced by clear_marks().

void GC_add_to_heap ( struct hblk p,
word  bytes 
)

Definition at line 368 of file alloc.c.

References BYTES_TO_WORDS, GC_freehblk(), GC_greatest_plausible_heap_addr, GC_heapsize, GC_install_header(), GC_least_plausible_heap_addr, HDR, and HDR_BYTES.

Referenced by alloc_mark_stack(), and GC_expand_hp_inner().

word GC_adj_words_allocd (  ) 

Definition at line 144 of file alloc.c.

References BYTES_TO_WORDS, GC_mem_freed, GC_non_gc_bytes, GC_non_gc_bytes_at_gc, and GC_words_allocd.

Referenced by GC_gcollect_inner().

ptr_t GC_allocobj ( word  sz,
int  kind 
)

Definition at line 495 of file alloc.c.

References GC_collect_or_expand(), GC_continue_reclaim(), GC_new_hblk(), GC_obj_kinds, and obj_kind::ok_freelist.

Referenced by GC_generic_malloc(), and GC_generic_malloc_words_small().

void GC_clear_a_few_frames (  ) 

Definition at line 176 of file alloc.c.

References NWORDS.

Referenced by GC_gcollect_inner().

void GC_clear_hdr_marks ( hdr hhdr  ) 

Definition at line 90 of file alloc.c.

References bzero, and MARK_BITS_SZ.

Referenced by clear_marks_for_block(), and setup_header().

void GC_collect_or_expand ( word  needed_blocks  ) 

Definition at line 469 of file alloc.c.

References EXIT, FALSE, GC_dont_gc, GC_err_printf0, GC_expand_hp_inner(), GC_gcollect_inner(), GC_hincr, TRUE, update_GC_hincr, and WARN.

Referenced by GC_allocobj(), and GC_generic_malloc().

int GC_expand_hp ( int  n  ) 

Definition at line 454 of file alloc.c.

References DCL_LOCK_STATE, DISABLE_SIGNALS, ENABLE_SIGNALS, GC_expand_hp_inner(), GC_init_inner(), GC_is_initialized, LOCK, and UNLOCK.

bool GC_expand_hp_inner ( word  n  ) 

Definition at line 413 of file alloc.c.

References FALSE, GC_add_to_heap(), GC_greatest_plausible_heap_addr, GC_hincr, GC_last_heap_addr, GC_least_plausible_heap_addr, GC_max(), GC_min(), GC_prev_heap_addr, GC_printf1, GET_MEM, HBLKSIZE, MAXHINCR, min_words_allocd(), SIGNB, TRUE, and WORDS_TO_BYTES.

Referenced by GC_collect_or_expand(), and GC_expand_hp().

void GC_gcollect (  ) 

Definition at line 350 of file alloc.c.

References DCL_LOCK_STATE, DISABLE_SIGNALS, ENABLE_SIGNALS, GC_gcollect_inner(), GC_init_inner(), GC_is_initialized, GC_noop(), LOCK, TRUE, and UNLOCK.

bool GC_gcollect_inner ( bool  force  ) 

Definition at line 194 of file alloc.c.

References clear_mark_bit_from_hdr, clear_marks(), CLOCK_TYPE, FALSE, GC_adj_words_allocd(), GC_check_heap(), GC_clear_a_few_frames(), GC_debugging_started, GC_dont_expand, GC_finalize(), GC_gc_no, GC_heapsize, GC_mark_roots(), GC_mem_found, GC_mem_freed, GC_n_kinds, GC_non_gc_bytes, GC_non_gc_bytes_at_gc, GC_noop(), GC_obj_kinds, GC_printf0, GC_printf1, GC_printf2, GC_promote_black_lists(), GC_start_reclaim(), GC_words_allocd, GC_words_allocd_before_gc, GET_TIME, HBLKPTR, HDR, MAXOBJSZ, min_words_allocd(), MS_TIME_DIFF, obj_link, set_mark_bit_from_hdr, START_WORLD, STOP_WORLD, TRUE, and WORDS_TO_BYTES.

Referenced by GC_collect_or_expand(), and GC_gcollect().

ptr_t GC_max ( ptr_t  x,
ptr_t  y 
)

Definition at line 395 of file alloc.c.

Referenced by GC_expand_hp_inner().

ptr_t GC_min ( ptr_t  x,
ptr_t  y 
)

Definition at line 401 of file alloc.c.

Referenced by GC_expand_hp_inner().

static word min_words_allocd (  )  [static]

Definition at line 123 of file alloc.c.

References BYTES_TO_WORDS, dummy, GC_free_space_divisor, GC_heapsize, GC_root_size, and GC_stackbottom.

Referenced by GC_expand_hp_inner(), and GC_gcollect_inner().


Variable Documentation

char* GC_copyright[]

Initial value:

{"Copyright 1988,1989 Hans-J. Boehm and Alan J. Demers",
"Copyright (c) 1991,1992 by Xerox Corporation.  All rights reserved.",
"THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY",
" EXPRESSED OR IMPLIED.  ANY USE IS AT YOUR OWN RISK."}

Definition at line 77 of file alloc.c.

bool GC_dont_expand = 0

Definition at line 117 of file alloc.c.

Referenced by GC_gcollect_inner().

word GC_free_space_divisor = 4

Definition at line 119 of file alloc.c.

Referenced by min_words_allocd().

word GC_gc_no = 0

Definition at line 75 of file alloc.c.

Referenced by GC_clear_stack(), and GC_gcollect_inner().

ptr_t GC_greatest_plausible_heap_addr = 0

Definition at line 393 of file alloc.c.

Referenced by GC_add_to_heap(), GC_expand_hp_inner(), GC_mark(), and GC_mark_all_stack().

ptr_t GC_least_plausible_heap_addr = (ptr_t)ONES

Definition at line 392 of file alloc.c.

Referenced by GC_add_to_heap(), GC_expand_hp_inner(), GC_mark(), and GC_mark_all_stack().

signed_word GC_mem_found

Definition at line 15 of file reclaim.c.

Referenced by GC_gcollect_inner(), GC_reclaim_block(), GC_reclaim_clear(), GC_reclaim_clear2(), GC_reclaim_clear4(), GC_reclaim_uninit(), GC_reclaim_uninit2(), and GC_reclaim_uninit4().

word GC_non_gc_bytes = 0

Definition at line 73 of file alloc.c.

Referenced by free(), GC_adj_words_allocd(), GC_gcollect_inner(), malloc(), malloc_atomic(), realloc(), and unsafe_free().


Generated on Fri Jan 25 10:39:48 2008 for russell by  doxygen 1.5.4