+added a _PREPAREGC macro.

This commit is contained in:
Wang Renxin 2017-11-16 19:52:38 +08:00
parent edd04a3c7d
commit 3b60064058

View File

@ -1706,6 +1706,9 @@ static void _real_to_str(real_t r, char* str, size_t size, size_t afterpoint);
#ifndef _GCNOW #ifndef _GCNOW
# define _GCNOW(__s) (!!(__s)) # define _GCNOW(__s) (!!(__s))
#endif /* _GCNOW */ #endif /* _GCNOW */
#ifndef _PREPAREGC
# define _PREPAREGC(__s, __g) do { ((void)(__s)); ((void)(__g)); } while(0)
#endif /* _PREPAREGC */
#ifndef _PREVGC #ifndef _PREVGC
# define _PREVGC(__s, __g) do { ((void)(__s)); ((void)(__g)); } while(0) # define _PREVGC(__s, __g) do { ((void)(__s)); ((void)(__g)); } while(0)
#endif /* _PREVGC */ #endif /* _PREVGC */
@ -6813,10 +6816,11 @@ static void _gc_collect_garbage(mb_interpreter_t* s, int depth) {
if(gc->disabled) if(gc->disabled)
return; return;
/* Avoid infinity loop */ /* Prepare for GC */
if(gc->collecting) if(gc->collecting)
return; return;
gc->collecting++; gc->collecting++;
_PREPAREGC(s, gc);
/* Get reachable information */ /* Get reachable information */
valid = _ht_create(0, _ht_cmp_ref, _ht_hash_ref, _do_nothing_on_object); valid = _ht_create(0, _ht_cmp_ref, _ht_hash_ref, _do_nothing_on_object);