store stack base and end
This commit is contained in:
parent
643d8be66d
commit
1a45eab148
|
@ -13,6 +13,8 @@ struct pic_env {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
pic_value *sp;
|
pic_value *sp;
|
||||||
|
pic_value *stbase, *stend;
|
||||||
|
|
||||||
struct pic_env *global_env;
|
struct pic_env *global_env;
|
||||||
} pic_state;
|
} pic_state;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,11 @@ pic_open()
|
||||||
pic_state *pic;
|
pic_state *pic;
|
||||||
|
|
||||||
pic = (pic_state *)malloc(sizeof(pic_state));
|
pic = (pic_state *)malloc(sizeof(pic_state));
|
||||||
pic->sp = (pic_value *)malloc(sizeof(pic_value) * 1024);
|
|
||||||
|
/* prepare VM stack */
|
||||||
|
pic->stbase = pic->sp = (pic_value *)malloc(sizeof(pic_value) * 1024);
|
||||||
|
pic->stend = pic->stbase + 1024;
|
||||||
|
|
||||||
pic->global_env = pic_new_empty_env();
|
pic->global_env = pic_new_empty_env();
|
||||||
|
|
||||||
return pic;
|
return pic;
|
||||||
|
|
Loading…
Reference in New Issue