From 3f7e4b09539f85369ffb08bc2c1e6b8de8f1a067 Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Wed, 16 Oct 2019 09:04:09 +0000 Subject: [PATCH] added --procstksize to bin/main.c --- moo/bin/main.c | 14 +++++++++----- moo/lib/moo-std.h | 1 + moo/lib/std.c | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/moo/bin/main.c b/moo/bin/main.c index 230f7a6..33d0544 100644 --- a/moo/bin/main.c +++ b/moo/bin/main.c @@ -89,6 +89,7 @@ int main (int argc, char* argv[]) { { ":log", 'l' }, { ":memsize", 'm' }, + { ":procstksize", '\0' }, { "large-pages", '\0' }, { ":base-charset", '\0' }, { ":input-charset", '\0' }, @@ -112,7 +113,8 @@ int main (int argc, char* argv[]) print_usage: fprintf (stderr, "Usage: %s [options] filename ...\n", argv[0]); fprintf (stderr, " --log filename[,logopts]\n"); - fprintf (stderr, " --memsize number\n"); + fprintf (stderr, " --memsize=bytes\n"); + fprintf (stderr, " --procstksize=number of oops\n"); fprintf (stderr, " --large-pages\n"); fprintf (stderr, " --base-charset=name\n"); fprintf (stderr, " --input-charset=name\n"); @@ -145,7 +147,12 @@ int main (int argc, char* argv[]) break; case '\0': - if (moo_comp_bcstr(opt.lngopt, "large-pages") == 0) + if (moo_comp_bcstr(opt.lngopt, "procstksize") == 0) + { + cfg.proc_stk_size = strtoul(opt.arg, MOO_NULL, 0); + break; + } + else if (moo_comp_bcstr(opt.lngopt, "large-pages") == 0) { cfg.large_pages = 1; break; @@ -224,13 +231,10 @@ int main (int argc, char* argv[]) { moo_oow_t tab_size; - tab_size = 5000; moo_setoption (moo, MOO_OPTION_SYMTAB_SIZE, &tab_size); tab_size = 5000; moo_setoption (moo, MOO_OPTION_SYSDIC_SIZE, &tab_size); - tab_size = 600; - moo_setoption (moo, MOO_OPTION_PROCSTK_SIZE, &tab_size); } if (moo_ignite(moo, memsize) <= -1) diff --git a/moo/lib/moo-std.h b/moo/lib/moo-std.h index 6ec9d34..caad809 100644 --- a/moo/lib/moo-std.h +++ b/moo/lib/moo-std.h @@ -15,6 +15,7 @@ struct moo_cfgstd_t { moo_cfgstd_type_t type; + moo_oow_t proc_stk_size; int large_pages; moo_cmgr_t* cmgr; moo_cmgr_t* input_cmgr; diff --git a/moo/lib/std.c b/moo/lib/std.c index b5a5811..ce69fd2 100644 --- a/moo/lib/std.c +++ b/moo/lib/std.c @@ -4143,6 +4143,11 @@ moo_t* moo_openstd (moo_oow_t xtnsize, const moo_cfgstd_t* cfg, moo_errinf_t* er moo_setoption (moo, MOO_OPTION_LOG_MASK, &bm); } + if (cfg && cfg->proc_stk_size > 0) + { + moo_setoption (moo, MOO_OPTION_PROCSTK_SIZE, &cfg->proc_stk_size); + } + if (cfg && handle_cfg_options(moo, cfg) <= -1) { if (errinfo) moo_geterrinf (moo, errinfo);