mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
6fb8d31597
commit
7adc4f4586
2 changed files with 22 additions and 13 deletions
|
@ -18,6 +18,19 @@
|
|||
#include <math.h>
|
||||
// TODO: #include <pthread.h>
|
||||
|
||||
// Maximum number of args that GC will accept
|
||||
#define NUM_GC_ANS 128
|
||||
|
||||
// Which way does the CPU grow its stack?
|
||||
#define STACK_GROWS_DOWNWARD 1
|
||||
|
||||
// Size of the stack buffer, in bytes.
|
||||
// This is used as the first generation of the GC.
|
||||
#define STACK_SIZE 250000
|
||||
|
||||
// Size of a "page" on the heap (the 2nd generation), in bytes.
|
||||
#define HEAP_SIZE 6000000
|
||||
|
||||
/* Define general object type. */
|
||||
typedef void *object;
|
||||
|
||||
|
@ -27,6 +40,10 @@ struct gc_thread_data_t {
|
|||
// Data needed for stack-based minor GC
|
||||
char *stack_start;
|
||||
char *stack_limit;
|
||||
TODO:
|
||||
object gc_cont;
|
||||
object *gc_ans; //[NUM_GC_ANS];
|
||||
short gc_num_ans;
|
||||
// List of objects moved to heap during minor GC
|
||||
void **moveBuf;
|
||||
int moveBufLen;
|
||||
|
@ -142,19 +159,6 @@ void gc_wait_handshake();
|
|||
/* Show diagnostic information for the GC when program terminates */
|
||||
#define DEBUG_SHOW_DIAG 0
|
||||
|
||||
/* Maximum number of args that GC will accept */
|
||||
#define NUM_GC_ANS 128
|
||||
|
||||
/* Which way does the CPU grow its stack? */
|
||||
#define STACK_GROWS_DOWNWARD 1
|
||||
|
||||
/* Size of the stack buffer, in bytes.
|
||||
This is used as the first generation of the GC. */
|
||||
#define STACK_SIZE 250000
|
||||
|
||||
/* Size of a "page" on the heap (the 2nd generation), in bytes. */
|
||||
#define HEAP_SIZE 6000000
|
||||
|
||||
/* Define size of object tags */
|
||||
typedef long tag_type;
|
||||
|
||||
|
|
|
@ -81,6 +81,8 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index) {
|
|||
/* Global variables. */
|
||||
gc_heap *Cyc_heap;
|
||||
gc_thread_data *Cyc_thread;
|
||||
|
||||
TODO: get rid of globals below that are not needed
|
||||
clock_t start; /* Starting time. */
|
||||
char *bottom; /* Bottom of tospace. */
|
||||
char *allocp; /* Cheney allocate pointer. */
|
||||
|
@ -92,8 +94,11 @@ char *dhbottom; /* Bottom of data heap */
|
|||
char *dhallocp; /* Current place in data heap */
|
||||
char *dhalloc_limit; /* GC beyond this limit */
|
||||
char *dhalloc_end;
|
||||
|
||||
long no_gcs = 0; /* Count the number of GC's. */
|
||||
long no_major_gcs = 0; /* Count the number of GC's. */
|
||||
|
||||
TODO: after previous change, move these to thread data structure
|
||||
object gc_cont; /* GC continuation closure. */
|
||||
object gc_ans[NUM_GC_ANS]; /* argument for GC continuation closure. */
|
||||
int gc_num_ans;
|
||||
|
|
Loading…
Add table
Reference in a new issue