make iseq length configurable

This commit is contained in:
Yuichi Nishiwaki 2014-01-18 22:54:28 +09:00
parent 494989ff3e
commit 9fadf16fdb
2 changed files with 5 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#define PIC_MACROS_SIZE 1024 #define PIC_MACROS_SIZE 1024
#define PIC_SYM_POOL_SIZE 128 #define PIC_SYM_POOL_SIZE 128
#define PIC_POOL_SIZE 1024 #define PIC_POOL_SIZE 1024
#define PIC_ISEQ_SIZE 1024
/* enable all debug flags */ /* enable all debug flags */
/* #define DEBUG 1 */ /* #define DEBUG 1 */

View File

@ -74,9 +74,9 @@ new_global_scope(pic_state *pic)
scope->localc = -1; scope->localc = -1;
scope->dirty_flags = NULL; scope->dirty_flags = NULL;
scope->varg = false; scope->varg = false;
scope->code = (struct pic_code *)pic_alloc(pic, sizeof(struct pic_code) * 1024); scope->code = (struct pic_code *)pic_calloc(pic, PIC_ISEQ_SIZE, sizeof(struct pic_code));
scope->clen = 0; scope->clen = 0;
scope->ccapa = 1024; scope->ccapa = PIC_ISEQ_SIZE;
scope->irep = (struct pic_irep **)pic_calloc(pic, PIC_IREP_SIZE, sizeof(struct pic_irep *)); scope->irep = (struct pic_irep **)pic_calloc(pic, PIC_IREP_SIZE, sizeof(struct pic_irep *));
scope->ilen = 0; scope->ilen = 0;
scope->icapa = PIC_IREP_SIZE; scope->icapa = PIC_IREP_SIZE;
@ -121,9 +121,9 @@ new_local_scope(pic_state *pic, pic_value args, codegen_scope *scope)
new_scope->localc = l; new_scope->localc = l;
new_scope->dirty_flags = (int *)pic_calloc(pic, i + l, sizeof(int)); new_scope->dirty_flags = (int *)pic_calloc(pic, i + l, sizeof(int));
new_scope->code = (struct pic_code *)pic_alloc(pic, sizeof(struct pic_code) * 1024); new_scope->code = (struct pic_code *)pic_calloc(pic, PIC_ISEQ_SIZE, sizeof(struct pic_code));
new_scope->clen = 0; new_scope->clen = 0;
new_scope->ccapa = 1024; new_scope->ccapa = PIC_ISEQ_SIZE;
new_scope->irep = (struct pic_irep **)pic_calloc(pic, PIC_IREP_SIZE, sizeof(struct pic_irep *)); new_scope->irep = (struct pic_irep **)pic_calloc(pic, PIC_IREP_SIZE, sizeof(struct pic_irep *));
new_scope->ilen = 0; new_scope->ilen = 0;