remove pic->ccnt
This commit is contained in:
parent
eea41c53d7
commit
17ccaea236
|
@ -9,8 +9,6 @@
|
||||||
struct cont {
|
struct cont {
|
||||||
PIC_JMPBUF *jmp;
|
PIC_JMPBUF *jmp;
|
||||||
|
|
||||||
int id;
|
|
||||||
|
|
||||||
struct checkpoint *cp;
|
struct checkpoint *cp;
|
||||||
ptrdiff_t sp_offset;
|
ptrdiff_t sp_offset;
|
||||||
ptrdiff_t ci_offset;
|
ptrdiff_t ci_offset;
|
||||||
|
@ -39,7 +37,6 @@ pic_save_point(pic_state *pic, struct cont *cont, PIC_JMPBUF *jmp)
|
||||||
cont->prev = pic->cc;
|
cont->prev = pic->cc;
|
||||||
cont->retc = 0;
|
cont->retc = 0;
|
||||||
cont->retv = NULL;
|
cont->retv = NULL;
|
||||||
cont->id = pic->ccnt++;
|
|
||||||
|
|
||||||
pic->cc = cont;
|
pic->cc = cont;
|
||||||
}
|
}
|
||||||
|
@ -109,18 +106,15 @@ cont_call(pic_state *pic)
|
||||||
{
|
{
|
||||||
int argc;
|
int argc;
|
||||||
pic_value *argv;
|
pic_value *argv;
|
||||||
int id;
|
|
||||||
struct cont *cc, *cont;
|
struct cont *cc, *cont;
|
||||||
|
|
||||||
pic_get_args(pic, "*", &argc, &argv);
|
pic_get_args(pic, "*", &argc, &argv);
|
||||||
|
|
||||||
cont = pic_data(pic, pic_closure_ref(pic, 0));
|
cont = pic_data(pic, pic_closure_ref(pic, 0));
|
||||||
|
|
||||||
id = cont->id;
|
|
||||||
|
|
||||||
/* check if continuation is alive */
|
/* check if continuation is alive */
|
||||||
for (cc = pic->cc; cc != NULL; cc = cc->prev) {
|
for (cc = pic->cc; cc != NULL; cc = cc->prev) {
|
||||||
if (cc->id == id) {
|
if (cc == cont) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ struct pic_state {
|
||||||
|
|
||||||
struct checkpoint *cp;
|
struct checkpoint *cp;
|
||||||
struct cont *cc;
|
struct cont *cc;
|
||||||
int ccnt;
|
|
||||||
|
|
||||||
pic_value *sp;
|
pic_value *sp;
|
||||||
pic_value *stbase, *stend;
|
pic_value *stbase, *stend;
|
||||||
|
|
|
@ -208,7 +208,6 @@ pic_open(pic_allocf allocf, void *userdata)
|
||||||
|
|
||||||
/* continuation chain */
|
/* continuation chain */
|
||||||
pic->cc = NULL;
|
pic->cc = NULL;
|
||||||
pic->ccnt = 0;
|
|
||||||
|
|
||||||
/* root block */
|
/* root block */
|
||||||
pic->cp = NULL;
|
pic->cp = NULL;
|
||||||
|
|
Loading…
Reference in New Issue