typedef struct pic_block pic_block
This commit is contained in:
parent
751d0f87f8
commit
920674a6ef
|
@ -68,18 +68,18 @@ typedef struct {
|
|||
struct pic_env *env;
|
||||
} pic_callinfo;
|
||||
|
||||
struct pic_block {
|
||||
typedef struct pic_block {
|
||||
struct pic_block *prev;
|
||||
int depth;
|
||||
struct pic_proc *in, *out;
|
||||
unsigned refcnt;
|
||||
};
|
||||
} pic_block;
|
||||
|
||||
typedef struct {
|
||||
int argc;
|
||||
char **argv, **envp;
|
||||
|
||||
struct pic_block *blk;
|
||||
pic_block *blk;
|
||||
|
||||
pic_value *sp;
|
||||
pic_value *stbase, *stend;
|
||||
|
|
|
@ -13,7 +13,7 @@ struct pic_cont {
|
|||
PIC_OBJECT_HEADER
|
||||
jmp_buf jmp;
|
||||
|
||||
struct pic_block *blk;
|
||||
pic_block *blk;
|
||||
|
||||
pic_value *stk_pos, *stk_ptr;
|
||||
size_t stk_len;
|
||||
|
@ -40,7 +40,7 @@ struct pic_cont {
|
|||
} while (0)
|
||||
|
||||
#define PIC_BLK_DECREF(pic,blk) do { \
|
||||
struct pic_block *_a = (blk), *_b; \
|
||||
pic_block *_a = (blk), *_b; \
|
||||
while (_a) { \
|
||||
if (! --_a->refcnt) { \
|
||||
_b = _a->prev; \
|
||||
|
|
|
@ -182,7 +182,7 @@ restore_cont(pic_state *pic, struct pic_cont *cont)
|
|||
}
|
||||
|
||||
static void
|
||||
walk_to_block(pic_state *pic, struct pic_block *here, struct pic_block *there)
|
||||
walk_to_block(pic_state *pic, pic_block *here, pic_block *there)
|
||||
{
|
||||
if (here == there)
|
||||
return;
|
||||
|
@ -282,10 +282,10 @@ pic_cont_dynamic_wind(pic_state *pic)
|
|||
/* enter */
|
||||
pic_apply_argv(pic, in, 0);
|
||||
{
|
||||
struct pic_block *here;
|
||||
pic_block *here;
|
||||
|
||||
here = pic->blk;
|
||||
pic->blk = (struct pic_block *)pic_alloc(pic, sizeof(struct pic_block));
|
||||
pic->blk = (pic_block *)pic_alloc(pic, sizeof(pic_block));
|
||||
pic->blk->prev = here;
|
||||
pic->blk->depth = here->depth + 1;
|
||||
pic->blk->in = in;
|
||||
|
|
2
src/gc.c
2
src/gc.c
|
@ -318,7 +318,7 @@ static void gc_mark(pic_state *, pic_value);
|
|||
static void gc_mark_object(pic_state *pic, struct pic_object *obj);
|
||||
|
||||
static void
|
||||
gc_mark_block(pic_state *pic, struct pic_block *blk)
|
||||
gc_mark_block(pic_state *pic, pic_block *blk)
|
||||
{
|
||||
while (blk) {
|
||||
if (blk->in)
|
||||
|
|
|
@ -28,7 +28,7 @@ pic_open(int argc, char *argv[], char **envp)
|
|||
pic->envp = envp;
|
||||
|
||||
/* root block */
|
||||
pic->blk = (struct pic_block *)malloc(sizeof(struct pic_block));
|
||||
pic->blk = (pic_block *)malloc(sizeof(pic_block));
|
||||
pic->blk->prev = NULL;
|
||||
pic->blk->depth = 0;
|
||||
pic->blk->in = pic->blk->out = NULL;
|
||||
|
|
|
@ -31,7 +31,7 @@ pic_system_exit(pic_state *pic)
|
|||
{
|
||||
pic_value v;
|
||||
int argc, status = EXIT_SUCCESS;
|
||||
struct pic_block *blk;
|
||||
pic_block *blk;
|
||||
|
||||
argc = pic_get_args(pic, "|o", &v);
|
||||
if (argc == 1) {
|
||||
|
|
Loading…
Reference in New Issue