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

#include "gc.h"
#include "gc_private.h"

Go to the source code of this file.

Data Structures

struct  disappearing_link
struct  finalizable_object

Defines

#define I_HIDE_POINTERS
#define LOG_TSIZE   7
#define TSIZE   (1 << LOG_TSIZE)
#define HASH(addr)
#define ALLOC(x, t)   t *x = (t *)GC_malloc(sizeof (t))

Typedefs

typedef char * void_star

Functions

int GC_register_disappearing_link (void_star *link)
int GC_unregister_disappearing_link (void_star *link)
bool GC_is_marked (ptr_t p)
void GC_set_mark_bit (ptr_t p)
void GC_clear_mark_bit (ptr_t p)
void GC_register_finalizer (void_star obj, GC_finalization_proc fn, void_star cd, GC_finalization_proc *ofn, void_star *ocd)
void GC_finalize ()
void_star GC_call_with_alloc_lock (GC_fn_type fn, void_star client_data)

Variables

static struct disappearing_linkdl_head [TSIZE]
static struct finalizable_objectfo_head [TSIZE]


Define Documentation

#define ALLOC ( x,
 )     t *x = (t *)GC_malloc(sizeof (t))

Definition at line 40 of file finalize.c.

Referenced by GC_register_disappearing_link(), and GC_register_finalizer().

#define HASH ( addr   ) 

Value:

((((word)(addr) >> 3) ^ ((word)(addr) >> (3+LOG_TSIZE))) \
    & (TSIZE - 1))

Definition at line 22 of file finalize.c.

#define I_HIDE_POINTERS

Definition at line 11 of file finalize.c.

#define LOG_TSIZE   7

Definition at line 20 of file finalize.c.

#define TSIZE   (1 << LOG_TSIZE)

Definition at line 21 of file finalize.c.

Referenced by GC_finalize().


Typedef Documentation

typedef char* void_star

Definition at line 17 of file finalize.c.


Function Documentation

void_star GC_call_with_alloc_lock ( GC_fn_type  fn,
void_star  client_data 
)

Definition at line 295 of file finalize.c.

References DCL_LOCK_STATE, DISABLE_SIGNALS, ENABLE_SIGNALS, LOCK, and UNLOCK.

void GC_clear_mark_bit ( ptr_t  p  ) 

Definition at line 140 of file finalize.c.

References clear_mark_bit_from_hdr, HBLKPTR, and HDR.

Referenced by GC_finalize().

void GC_finalize (  ) 

Definition at line 219 of file finalize.c.

References ABORT, dl_head, finalizable_object::fo_client_data, finalizable_object::fo_fn, fo_head, finalizable_object::fo_hidden_base, finalizable_object::fo_next, finalizable_object::fo_object_size, GC_clear_mark_bit(), GC_is_marked(), GC_mark_all(), GC_set_mark_bit(), and TSIZE.

Referenced by GC_gcollect_inner().

bool GC_is_marked ( ptr_t  p  ) 

Definition at line 120 of file finalize.c.

References HBLKPTR, HDR, and mark_bit_from_hdr.

Referenced by GC_finalize().

int GC_register_disappearing_link ( void_star link  ) 

Definition at line 42 of file finalize.c.

References ABORT, ALLOC, DCL_LOCK_STATE, DISABLE_SIGNALS, dl_head, disappearing_link::dl_hidden_base, disappearing_link::dl_next, disappearing_link::dl_offset, ENABLE_SIGNALS, GC_base(), GC_free(), HASH, LOCK, and UNLOCK.

void GC_register_finalizer ( void_star  obj,
GC_finalization_proc  fn,
void_star  cd,
GC_finalization_proc ofn,
void_star ocd 
)

Definition at line 150 of file finalize.c.

References ABORT, ALLOC, DCL_LOCK_STATE, DISABLE_SIGNALS, ENABLE_SIGNALS, finalizable_object::fo_client_data, finalizable_object::fo_fn, fo_head, finalizable_object::fo_hidden_base, finalizable_object::fo_next, finalizable_object::fo_object_size, GC_base(), GC_free(), GC_size(), HASH, LOCK, and UNLOCK.

void GC_set_mark_bit ( ptr_t  p  ) 

Definition at line 130 of file finalize.c.

References HBLKPTR, HDR, and set_mark_bit_from_hdr.

Referenced by GC_finalize().

int GC_unregister_disappearing_link ( void_star link  ) 

Definition at line 82 of file finalize.c.

References DCL_LOCK_STATE, DISABLE_SIGNALS, dl_head, disappearing_link::dl_hidden_base, disappearing_link::dl_next, disappearing_link::dl_offset, ENABLE_SIGNALS, GC_base(), GC_free(), HASH, LOCK, and UNLOCK.


Variable Documentation

struct disappearing_link * dl_head[TSIZE] [static]

Referenced by GC_finalize(), GC_register_disappearing_link(), and GC_unregister_disappearing_link().

struct finalizable_object * fo_head[TSIZE] [static]

Referenced by GC_finalize(), and GC_register_finalizer().


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