From ea6230e90cfadaa2bbb3d6feca774a8e79b01952 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 15 Oct 2013 23:28:23 +0900 Subject: [PATCH] configurable stack size --- include/picconf.h | 1 + src/state.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/picconf.h b/include/picconf.h index da97cad5..a609439d 100644 --- a/include/picconf.h +++ b/include/picconf.h @@ -3,6 +3,7 @@ #define PIC_ARENA_SIZE 100 #define PIC_HEAP_SIZE 8192 +#define PIC_STACK_SIZE 1024 #define DEBUG 1 diff --git a/src/state.c b/src/state.c index d6111bfa..3e7b1565 100644 --- a/src/state.c +++ b/src/state.c @@ -26,8 +26,8 @@ pic_open() pic = (pic_state *)malloc(sizeof(pic_state)); /* prepare VM stack */ - pic->stbase = pic->sp = (pic_value *)malloc(sizeof(pic_value) * 1024); - pic->stend = pic->stbase + 1024; + pic->stbase = pic->sp = (pic_value *)malloc(sizeof(pic_value) * PIC_STACK_SIZE); + pic->stend = pic->stbase + PIC_STACK_SIZE; /* memory heap */ pic->heap = (struct heap_page *)malloc(sizeof(struct heap_page));