From 1ff8672a11f8031868b5c0e40bbce78a9bc55d5b Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 21 Jan 2015 21:59:50 +0900 Subject: [PATCH] add PIC_SYMS_SIZE constant --- extlib/benz/codegen.c | 4 ++-- extlib/benz/include/picrin/config.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extlib/benz/codegen.c b/extlib/benz/codegen.c index fa3125a7..51d94e6a 100644 --- a/extlib/benz/codegen.c +++ b/extlib/benz/codegen.c @@ -1005,9 +1005,9 @@ push_codegen_context(codegen_state *state, pic_value name, pic_value args, pic_v cxt->plen = 0; cxt->pcapa = PIC_POOL_SIZE; - cxt->syms = pic_calloc(pic, PIC_POOL_SIZE, sizeof(pic_sym *)); + cxt->syms = pic_calloc(pic, PIC_SYMS_SIZE, sizeof(pic_sym *)); cxt->slen = 0; - cxt->scapa = PIC_POOL_SIZE; + cxt->scapa = PIC_SYMS_SIZE; state->cxt = cxt; diff --git a/extlib/benz/include/picrin/config.h b/extlib/benz/include/picrin/config.h index 889e268b..7a24f77e 100644 --- a/extlib/benz/include/picrin/config.h +++ b/extlib/benz/include/picrin/config.h @@ -26,6 +26,8 @@ /* #define PIC_POOL_SIZE 8 */ +/* #define PIC_SYMS_SIZE 32 */ + /* #define PIC_ISEQ_SIZE 1024 */ /** enable all debug flags */ @@ -85,6 +87,10 @@ # define PIC_POOL_SIZE 8 #endif +#ifndef PIC_SYMS_SIZE +# define PIC_SYMS_SIZE 32 +#endif + #ifndef PIC_ISEQ_SIZE # define PIC_ISEQ_SIZE 1024 #endif