mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 22:59:16 +02:00
gc: revert adding STAGE_FORCING
Use gc_start_major_collection() instead. Partial work towards addressing issue #534.
This commit is contained in:
parent
41ac00d6be
commit
48b95db3d2
4 changed files with 2 additions and 16 deletions
8
gc.c
8
gc.c
|
@ -2534,14 +2534,6 @@ void gc_collector()
|
||||||
ck_pr_cas_int(&gc_stage, STAGE_SWEEPING, STAGE_RESTING);
|
ck_pr_cas_int(&gc_stage, STAGE_SWEEPING, STAGE_RESTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gc_force(void)
|
|
||||||
{
|
|
||||||
/* try to force the collector to run */
|
|
||||||
ck_pr_cas_int(&gc_stage, STAGE_RESTING, STAGE_FORCING);
|
|
||||||
/* if the collector thread was idle, then begin collecting */
|
|
||||||
ck_pr_cas_int(&gc_stage, STAGE_FORCING, STAGE_CLEAR_OR_MARKING);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *collector_main(void *arg)
|
void *collector_main(void *arg)
|
||||||
{
|
{
|
||||||
int stage;
|
int stage;
|
||||||
|
|
|
@ -52,11 +52,6 @@ void GC(void *, closure, object *, int);
|
||||||
*/
|
*/
|
||||||
void gc_init_heap(long heap_size);
|
void gc_init_heap(long heap_size);
|
||||||
|
|
||||||
/**
|
|
||||||
* \ingroup gc_force
|
|
||||||
*/
|
|
||||||
void gc_force(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \defgroup prim Primitives
|
* \defgroup prim Primitives
|
||||||
* @brief Built-in Scheme functions provided by the runtime library
|
* @brief Built-in Scheme functions provided by the runtime library
|
||||||
|
|
|
@ -264,7 +264,7 @@ typedef enum { STATUS_ASYNC, STATUS_SYNC1, STATUS_SYNC2
|
||||||
/** Stages of the Major GC's collector thread */
|
/** Stages of the Major GC's collector thread */
|
||||||
typedef enum { STAGE_CLEAR_OR_MARKING, STAGE_TRACING
|
typedef enum { STAGE_CLEAR_OR_MARKING, STAGE_TRACING
|
||||||
//, STAGE_REF_PROCESSING
|
//, STAGE_REF_PROCESSING
|
||||||
, STAGE_SWEEPING, STAGE_RESTING, STAGE_FORCING
|
, STAGE_SWEEPING, STAGE_RESTING
|
||||||
} gc_stage_type;
|
} gc_stage_type;
|
||||||
|
|
||||||
// Constant colors are defined here.
|
// Constant colors are defined here.
|
||||||
|
@ -377,7 +377,6 @@ struct gc_thread_data_t {
|
||||||
|
|
||||||
/* GC prototypes */
|
/* GC prototypes */
|
||||||
void gc_initialize(void);
|
void gc_initialize(void);
|
||||||
void gc_force(void);
|
|
||||||
void gc_add_new_unrunning_mutator(gc_thread_data * thd);
|
void gc_add_new_unrunning_mutator(gc_thread_data * thd);
|
||||||
void gc_add_mutator(gc_thread_data * thd);
|
void gc_add_mutator(gc_thread_data * thd);
|
||||||
void gc_remove_mutator(gc_thread_data * thd);
|
void gc_remove_mutator(gc_thread_data * thd);
|
||||||
|
|
|
@ -7181,7 +7181,7 @@ void Cyc_exit_thread(void *data, object _, int argc, object * args)
|
||||||
gc_remove_mutator(thd);
|
gc_remove_mutator(thd);
|
||||||
ck_pr_cas_int((int *)&(thd->thread_state), CYC_THREAD_STATE_RUNNABLE,
|
ck_pr_cas_int((int *)&(thd->thread_state), CYC_THREAD_STATE_RUNNABLE,
|
||||||
CYC_THREAD_STATE_TERMINATED);
|
CYC_THREAD_STATE_TERMINATED);
|
||||||
gc_force();
|
gc_start_major_collection(thd);
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue