defined MOO_GC_TYPE_DEFAULT

This commit is contained in:
hyunghwan.chung 2020-12-01 15:04:30 +00:00
parent 26631d231c
commit f3d61ce0c9
3 changed files with 8 additions and 3 deletions

View File

@ -219,7 +219,12 @@ struct moo_gchdr_t
enum moo_gc_type_t
{
MOO_GC_TYPE_SEMISPACE,
MOO_GC_TYPE_MARK_SWEEP
#if defined(MOO_ENABLE_GC_MARK_SWEEP)
MOO_GC_TYPE_MARK_SWEEP,
MOO_GC_TYPE_DEFAULT = MOO_GC_TYPE_MARK_SWEEP
#else
MOO_GC_TYPE_DEFAULT = MOO_GC_TYPE_SEMISPACE
#endif
};
typedef enum moo_gc_type_t moo_gc_type_t;

View File

@ -4207,7 +4207,7 @@ moo_t* moo_openstd (moo_oow_t xtnsize, const moo_cfgstd_t* cfg, moo_errinf_t* er
vmprim.vm_getsig = vm_getsig;
vmprim.vm_setsig = vm_setsig;
moo = moo_open(&sys_mmgr, MOO_SIZEOF(xtn_t) + xtnsize, ((cfg && cfg->cmgr)? cfg->cmgr: moo_get_utf8_cmgr()), &vmprim, cfg->gc_type, errinfo);
moo = moo_open(&sys_mmgr, MOO_SIZEOF(xtn_t) + xtnsize, ((cfg && cfg->cmgr)? cfg->cmgr: moo_get_utf8_cmgr()), &vmprim, (cfg? cfg->gc_type: MOO_GC_TYPE_DEFAULT), errinfo);
if (MOO_UNLIKELY(!moo)) return MOO_NULL;
/* adjust the object size by the sizeof xtn_t so that moo_getxtn() returns the right pointer. */

View File

@ -79,7 +79,7 @@ EMSCRIPTEN_KEEPALIVE int open_moo (void)
vmprim.vm_muxwait = vm_muxwait;
vmprim.vm_sleep = vm_sleep;
moo = moo_open(&sys_mmgr, MOO_SIZEOF(xtn_t) + xtnsize, ((cfg && cfg->cmgr)? cfg->cmgr: moo_get_utf8_cmgr()), &vmprim, errinfo);
moo = moo_open(&sys_mmgr, MOO_SIZEOF(xtn_t) + xtnsize, ((cfg && cfg->cmgr)? cfg->cmgr: moo_get_utf8_cmgr()), &vmprim, (cfg? cfg->gc_type: MOO_GC_TYPE_DEFAULT), errinfo);
if (!moo) return MOO_NULL;
/* adjust the object size by the sizeof xtn_t so that qse_getxtn() returns the right pointer. */