fixed a potential problem cause be presence of NDEBUG

This commit is contained in:
hyunghwan.chung 2018-02-20 14:51:19 +00:00
parent f668f81234
commit 00e815b8ff
2 changed files with 1 additions and 5 deletions

View File

@ -102,9 +102,7 @@ int moo_init (moo_t* moo, moo_mmgr_t* mmgr, moo_oow_t heapsz, const moo_vmprim_t
moo->option.dfl_symtab_size = MOO_DFL_SYMTAB_SIZE;
moo->option.dfl_sysdic_size = MOO_DFL_SYSDIC_SIZE;
moo->option.dfl_procstk_size = MOO_DFL_PROCSTK_SIZE;
#if !defined(NDEBUG)
moo->option.karatsuba_cutoff = MOO_KARATSUBA_CUTOFF;
#endif
moo->log.capa = MOO_ALIGN_POW2(1, MOO_LOG_CAPA_ALIGN); /* TODO: is this a good initial size? */
/* alloate the log buffer in advance though it may get reallocated

View File

@ -1183,10 +1183,8 @@ struct moo_t
moo_oow_t dfl_sysdic_size;
moo_oow_t dfl_procstk_size;
#if !defined(NDEBUG)
/* set automatically when trait is set */
int karatsuba_cutoff;
#endif
int karatsuba_cutoff; /* used only if NDEBUG is not set */
} option;
moo_vmprim_t vmprim;