From 2c49ebe55830e76a8b08fe8e56be5ab0c9738f83 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 1 Jan 2021 07:34:21 +0000 Subject: [PATCH] renamed --memsize to --heapsize in bin/main.c allowed 0 as a heap size to indicate no use of xma --- bin/main.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/main.c b/bin/main.c index 2fd13b6..a4f5bd7 100644 --- a/bin/main.c +++ b/bin/main.c @@ -951,7 +951,7 @@ static void print_synerr (hcl_t* hcl) hcl_logbfmt (hcl, HCL_LOG_STDERR, "\n"); } -#define MIN_MEMSIZE 512000ul +#define DEFAULT_HEAPSIZE 512000ul int main (int argc, char* argv[]) { @@ -963,22 +963,23 @@ int main (int argc, char* argv[]) hcl_bci_t c; static hcl_bopt_lng_t lopt[] = { - { ":log", 'l' }, - { ":memsize", 'm' }, - { "large-pages", '\0' }, #if defined(HCL_BUILD_DEBUG) - { ":debug", '\0' }, /* NOTE: there is no short option for --debug */ + { ":debug", '\0' }, #endif + { ":heapsize", '\0' }, + { ":log", 'l' }, + + { "large-pages", '\0' }, { HCL_NULL, '\0' } }; static hcl_bopt_t opt = { - "l:m:v", + "l:v", lopt }; const char* logopt = HCL_NULL; - hcl_oow_t memsize = MIN_MEMSIZE; + hcl_oow_t heapsize = DEFAULT_HEAPSIZE; int verbose = 0; int large_pages = 0; @@ -1004,17 +1005,17 @@ int main (int argc, char* argv[]) logopt = opt.arg; break; - case 'm': - memsize = strtoul(opt.arg, HCL_NULL, 0); - if (memsize <= MIN_MEMSIZE) memsize = MIN_MEMSIZE; - break; - case 'v': verbose = 1; break; case '\0': - if (hcl_comp_bcstr(opt.lngopt, "large-pages") == 0) + if (hcl_comp_bcstr(opt.lngopt, "heapsize") == 0) + { + heapsize = strtoul(opt.arg, HCL_NULL, 0); + break; + } + else if (hcl_comp_bcstr(opt.lngopt, "large-pages") == 0) { large_pages = 1; break; @@ -1062,7 +1063,7 @@ int main (int argc, char* argv[]) vmprim.vm_gettime = hcl_vmprim_vm_gettime; vmprim.vm_sleep = hcl_vmprim_vm_sleep; - hcl = hcl_open(&sys_mmgr, HCL_SIZEOF(xtn_t), memsize, &vmprim, HCL_NULL); + hcl = hcl_open(&sys_mmgr, HCL_SIZEOF(xtn_t), heapsize, &vmprim, HCL_NULL); if (!hcl) { printf ("ERROR: cannot open hcl\n");