Classes | Macros | Typedefs | Functions | Variables
collector.h File Reference
#include "rgc_utils.h"
#include "xccmem.h"
Include dependency graph for collector.h:

Go to the source code of this file.

Classes

struct  _gc_data
 
struct  _sweeping_state
 
struct  barrier_struct
 
struct  ms_entry
 

Macros

#define active_mutator_num   gc_data.active_mutator_num
 
#define AM_UNIT   (M_UNIT)
 
#define AS_UNIT   (S_UNIT)
 
#define blacked_hd(p)   (p->h.bix & BLACKTAG)
 
#define blacked_map(p)   blacked_hd(p)
 
#define BLACKTAG   0x40
 
#define busy_sema_post(k)
 
#define busy_sema_wait(k)
 
#define collector_lock   gc_data.collector_lock
 
#define collector_sp   gc_data.collector_sp
 
#define collector_stack   gc_data.collector_stack
 
#define collector_stacklimit   gc_data.collector_stacklimit
 
#define colored_hd(p)   (p->h.bix & COLORTAG)
 
#define colored_map(p)   colored_hd(p)
 
#define COLORTAG   0x60
 
#define DEFAULT_EXPAND_SIZE_IDX   24 /* about ??? KB */
 
#define DEFAULT_GC_THRESHOLD   0.25
 
#define DEFAULT_MAX_RGCSTACK   32768 /* 16384 */
 
#define FREETAG   0x20
 
#define GC_ACTIVATE_CUSHION   15 /* 10...20 */
 
#define gc_cmp_cnt   gc_data.gc_cmp_cnt
 
#define gc_counter   gc_data.gc_counter
 
#define GC_GRANULARITY   2 /* 2, 4 */
 
#define gc_net_free   gc_data.gc_net_free
 
#define gc_phase   gc_data.gc_phase
 
#define GC_POINT
 
#define gc_point_sync   gc_data.gc_point_sync
 
#define GC_REGION(cmp_statement)   cmp_statement
 
#define gc_region_sync   gc_data.gc_region_sync
 
#define gc_state_lock   gc_data.gc_state_lock
 
#define gc_wakeup_cnt   gc_data.gc_wakeup_cnt
 
#define gc_wakeup_cv   gc_data.gc_wakeup_cv
 
#define GRAYTAG   0x20
 
#define INITIAL_HEAP_SIZE   2500
 
#define lock_collector   mutex_lock(&collector_lock)
 
#define M_UNIT   8000 /* 4000 */
 
#define marked_hd(p)   (p->h.bix & BLACKTAG)
 
#define marked_map(p)   marked_hd(p)
 
#define markoff_hd(p)   (p->h.bix &= TAGMASK)
 
#define markoff_map(p)   markoff_hd(p)
 
#define markon_hd(p)   (p->h.bix |= BLACKTAG)
 
#define markon_map(p)   markon_hd(p)
 
#define mut_stat_phase   gc_data.mut_stat_phase
 
#define pgcpop()   ( *(--(ctx->gsp)) )
 
#define pgcpush(v)
 
#define pgpush(v)   ( *ctx->gsp++ = ((pointer)v) )
 
#define PHASE_EPILOGUE   2
 
#define PHASE_MARK   4
 
#define PHASE_NOGC   0
 
#define PHASE_PROLOGUE   1
 
#define PHASE_ROOT_CORE   5
 
#define PHASE_ROOT_REM   6
 
#define PHASE_SWEEP   3
 
#define pointerpop(lv)
 
#define pointerpush(v)
 
#define ppush(v)   ( *psp++ = ((pointer)v) )
 
#define REALTIME_ALLOC_LIMIT_IDX   12 /* 1131 words */
 
#define ri_core_phase   gc_data.ri_core_phase
 
#define ri_end_cv   gc_data.ri_end_cv
 
#define S_UNIT   256 /* 128, 256, 512 */
 
#define TAGMASK   0x1f
 
#define unlock_collector   mutex_unlock(&collector_lock)
 

Typedefs

typedef struct barrier_structbarrier_t
 

Functions

unsigned int allocate_heap ()
 
barrier_t barrier_init (int)
 
void barrier_reset (barrier_t, int)
 
void barrier_wait (barrier_t)
 
void do_a_little_gc_work ()
 
void notify_gc ()
 

Variables

struct _gc_data gc_data
 
mutex_t gcstate_lock
 
char * minmemory =(char *)0xffffffff
 
volatile long newheap
 
volatile pointeroldpsp
 
volatile long pastfree
 
int ps_sem
 
volatile pointerpsp
 
pointer pstack []
 
mutex_t pstack_lock
 
pointerpstacklimit
 
barrier_t startup_barrier
 
volatile long sweepheap
 
struct _sweeping_state sweeping_state
 

Macro Definition Documentation

◆ active_mutator_num

#define active_mutator_num   gc_data.active_mutator_num

Definition at line 231 of file collector.h.

◆ AM_UNIT

#define AM_UNIT   (M_UNIT)

Definition at line 47 of file collector.h.

◆ AS_UNIT

#define AS_UNIT   (S_UNIT)

Definition at line 48 of file collector.h.

◆ blacked_hd

#define blacked_hd (   p)    (p->h.bix & BLACKTAG)

Definition at line 182 of file collector.h.

◆ blacked_map

#define blacked_map (   p)    blacked_hd(p)

Definition at line 176 of file collector.h.

◆ BLACKTAG

#define BLACKTAG   0x40

Definition at line 171 of file collector.h.

◆ busy_sema_post

#define busy_sema_post (   k)
Value:
{ \
int i; \
finish_access_before_read(); \
do { \
} while (cas_int(k, i, i + 1)); \
}

Definition at line 303 of file collector.h.

◆ busy_sema_wait

#define busy_sema_wait (   k)
Value:
{ \
int i; \
do { \
while ((i = read_volatile_int(k)) <= 0); \
} while (cas_int(k, i, i - 1)); \
start_access_after_write(); \
}

Definition at line 296 of file collector.h.

◆ collector_lock

#define collector_lock   gc_data.collector_lock

Definition at line 244 of file collector.h.

◆ collector_sp

#define collector_sp   gc_data.collector_sp

Definition at line 228 of file collector.h.

◆ collector_stack

#define collector_stack   gc_data.collector_stack

Definition at line 227 of file collector.h.

◆ collector_stacklimit

#define collector_stacklimit   gc_data.collector_stacklimit

Definition at line 229 of file collector.h.

◆ colored_hd

#define colored_hd (   p)    (p->h.bix & COLORTAG)

Definition at line 181 of file collector.h.

◆ colored_map

#define colored_map (   p)    colored_hd(p)

Definition at line 175 of file collector.h.

◆ COLORTAG

#define COLORTAG   0x60

Definition at line 172 of file collector.h.

◆ DEFAULT_EXPAND_SIZE_IDX

#define DEFAULT_EXPAND_SIZE_IDX   24 /* about ??? KB */

Definition at line 36 of file collector.h.

◆ DEFAULT_GC_THRESHOLD

#define DEFAULT_GC_THRESHOLD   0.25

Definition at line 38 of file collector.h.

◆ DEFAULT_MAX_RGCSTACK

#define DEFAULT_MAX_RGCSTACK   32768 /* 16384 */

Definition at line 34 of file collector.h.

◆ FREETAG

#define FREETAG   0x20

Definition at line 169 of file collector.h.

◆ GC_ACTIVATE_CUSHION

#define GC_ACTIVATE_CUSHION   15 /* 10...20 */

Definition at line 43 of file collector.h.

◆ gc_cmp_cnt

#define gc_cmp_cnt   gc_data.gc_cmp_cnt

Definition at line 248 of file collector.h.

◆ gc_counter

#define gc_counter   gc_data.gc_counter

Definition at line 232 of file collector.h.

◆ GC_GRANULARITY

#define GC_GRANULARITY   2 /* 2, 4 */

Definition at line 50 of file collector.h.

◆ gc_net_free

#define gc_net_free   gc_data.gc_net_free

Definition at line 249 of file collector.h.

◆ gc_phase

#define gc_phase   gc_data.gc_phase

Definition at line 230 of file collector.h.

◆ GC_POINT

#define GC_POINT

Definition at line 172 of file eus.h.

◆ gc_point_sync

#define gc_point_sync   gc_data.gc_point_sync

Definition at line 233 of file collector.h.

◆ GC_REGION

#define GC_REGION (   cmp_statement)    cmp_statement

Definition at line 173 of file eus.h.

◆ gc_region_sync

#define gc_region_sync   gc_data.gc_region_sync

Definition at line 234 of file collector.h.

◆ gc_state_lock

#define gc_state_lock   gc_data.gc_state_lock

Definition at line 243 of file collector.h.

◆ gc_wakeup_cnt

#define gc_wakeup_cnt   gc_data.gc_wakeup_cnt

Definition at line 247 of file collector.h.

◆ gc_wakeup_cv

#define gc_wakeup_cv   gc_data.gc_wakeup_cv

Definition at line 246 of file collector.h.

◆ GRAYTAG

#define GRAYTAG   0x20

Definition at line 170 of file collector.h.

◆ INITIAL_HEAP_SIZE

#define INITIAL_HEAP_SIZE   2500

Configuration parameters for RGC INITIAL_HEAP_SIZE: DEFAULT_EXPAND_SIZE_IDX: heap is expanded by this size at a time. REAL_TIME_ALLOC_LIMIT_IDX: real-time allocation are guranteed up to this size of memory requests. DEFAULT_GC_THRESHOLD: when heap vacancy rate is below this, the next gc cycle starts. R_UNIT: not yet used. M_UNIT: S_UNIT:

Definition at line 29 of file collector.h.

◆ lock_collector

#define lock_collector   mutex_lock(&collector_lock)

Definition at line 251 of file collector.h.

◆ M_UNIT

#define M_UNIT   8000 /* 4000 */

Definition at line 45 of file collector.h.

◆ marked_hd

#define marked_hd (   p)    (p->h.bix & BLACKTAG)

Definition at line 185 of file collector.h.

◆ marked_map

#define marked_map (   p)    marked_hd(p)

Definition at line 179 of file collector.h.

◆ markoff_hd

#define markoff_hd (   p)    (p->h.bix &= TAGMASK)

Definition at line 184 of file collector.h.

◆ markoff_map

#define markoff_map (   p)    markoff_hd(p)

Definition at line 178 of file collector.h.

◆ markon_hd

#define markon_hd (   p)    (p->h.bix |= BLACKTAG)

Definition at line 183 of file collector.h.

◆ markon_map

#define markon_map (   p)    markon_hd(p)

Definition at line 177 of file collector.h.

◆ mut_stat_phase

#define mut_stat_phase   gc_data.mut_stat_phase

Definition at line 236 of file collector.h.

◆ pgcpop

#define pgcpop ( )    ( *(--(ctx->gsp)) )

Definition at line 292 of file collector.h.

◆ pgcpush

#define pgcpush (   v)
Value:
( ctx->gsp < ctx->gcstacklimit ? \
pgpush(v) : error(E_GCSTACKOVER) )

Definition at line 290 of file collector.h.

◆ pgpush

#define pgpush (   v)    ( *ctx->gsp++ = ((pointer)v) )

Definition at line 289 of file collector.h.

◆ PHASE_EPILOGUE

#define PHASE_EPILOGUE   2

Definition at line 84 of file collector.h.

◆ PHASE_MARK

#define PHASE_MARK   4

Definition at line 87 of file collector.h.

◆ PHASE_NOGC

#define PHASE_NOGC   0

Definition at line 82 of file collector.h.

◆ PHASE_PROLOGUE

#define PHASE_PROLOGUE   1

Definition at line 83 of file collector.h.

◆ PHASE_ROOT_CORE

#define PHASE_ROOT_CORE   5

Definition at line 85 of file collector.h.

◆ PHASE_ROOT_REM

#define PHASE_ROOT_REM   6

Definition at line 86 of file collector.h.

◆ PHASE_SWEEP

#define PHASE_SWEEP   3

Definition at line 88 of file collector.h.

◆ pointerpop

#define pointerpop (   lv)
Value:
{ \
busy_sema_wait(ps_sem); \
lv = *(--psp); \
busy_sema_post(ps_sem); \
}

Definition at line 316 of file collector.h.

◆ pointerpush

#define pointerpush (   v)
Value:
{ \
busy_sema_wait(ps_sem); \
busy_sema_post(ps_sem); \
}

Definition at line 311 of file collector.h.

◆ ppush

#define ppush (   v)    ( *psp++ = ((pointer)v) )

Definition at line 293 of file collector.h.

◆ REALTIME_ALLOC_LIMIT_IDX

#define REALTIME_ALLOC_LIMIT_IDX   12 /* 1131 words */

Definition at line 40 of file collector.h.

◆ ri_core_phase

#define ri_core_phase   gc_data.ri_core_phase

Definition at line 235 of file collector.h.

◆ ri_end_cv

#define ri_end_cv   gc_data.ri_end_cv

Definition at line 245 of file collector.h.

◆ S_UNIT

#define S_UNIT   256 /* 128, 256, 512 */

Definition at line 46 of file collector.h.

◆ TAGMASK

#define TAGMASK   0x1f

Definition at line 168 of file collector.h.

◆ unlock_collector

#define unlock_collector   mutex_unlock(&collector_lock)

Definition at line 252 of file collector.h.

Typedef Documentation

◆ barrier_t

typedef struct barrier_struct * barrier_t

Function Documentation

◆ allocate_heap()

unsigned int allocate_heap ( )

Definition at line 1195 of file collector.c.

◆ barrier_init()

barrier_t barrier_init ( int  )

Definition at line 1128 of file collector.c.

◆ barrier_reset()

void barrier_reset ( barrier_t  ,
int   
)

Definition at line 1141 of file collector.c.

◆ barrier_wait()

void barrier_wait ( barrier_t  )

Definition at line 1155 of file collector.c.

◆ do_a_little_gc_work()

void do_a_little_gc_work ( )

◆ notify_gc()

void notify_gc ( )

Definition at line 716 of file collector.c.

Variable Documentation

◆ gc_data

struct _gc_data gc_data

Definition at line 53 of file collector.c.

◆ gcstate_lock

mutex_t gcstate_lock

◆ minmemory

char * minmemory =(char *)0xffffffff

Definition at line 54 of file memory.c.

◆ newheap

volatile long newheap

Definition at line 436 of file collector.h.

◆ oldpsp

volatile pointer* oldpsp

◆ pastfree

volatile long pastfree

Definition at line 436 of file collector.h.

◆ ps_sem

int ps_sem

Definition at line 1036 of file collector.c.

◆ psp

volatile pointer* psp

Definition at line 1120 of file collector.c.

◆ pstack

pointer pstack[]

Definition at line 1119 of file collector.c.

◆ pstack_lock

mutex_t pstack_lock

Definition at line 1122 of file collector.c.

◆ pstacklimit

pointer* pstacklimit

Definition at line 1121 of file collector.c.

◆ startup_barrier

barrier_t startup_barrier

Definition at line 54 of file collector.c.

◆ sweepheap

volatile long sweepheap

◆ sweeping_state

struct _sweeping_state sweeping_state
E_GCSTACKOVER
@ E_GCSTACKOVER
Definition: eus.h:925
ppush
#define ppush(v)
Definition: collector.h:293
pstacklimit
pointer * pstacklimit
Definition: collector.c:1121
read_volatile_int
#define read_volatile_int(loc)
Definition: xccmem.h:1039
error
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
Definition: eus.c:297
cell
Definition: eus.h:381
E_PSTACKOVER
@ E_PSTACKOVER
Definition: eus.h:926
cas_int
#define cas_int(loc, ov, nv)
Definition: xccmem.h:1087
psp
volatile pointer * psp
Definition: collector.c:1120
ps_sem
int ps_sem
Definition: collector.c:1036
v
GLfloat v[8][3]
Definition: cube.c:21


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 15 2023 02:06:43