diff --git a/HISTORY b/HISTORY index 2cbeb3e..2027cda 100755 --- a/HISTORY +++ b/HISTORY @@ -1,3 +1,6 @@ +Dec. 29 2015 +Improved GC with an array + Dec. 28 2015 Fixed a GC bug Fixed a wrong routine evaluation bug diff --git a/core/my_basic.c b/core/my_basic.c index 4805f99..e01eba4 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -84,7 +84,7 @@ extern "C" { /** Macros */ #define _VER_MAJOR 1 #define _VER_MINOR 1 -#define _VER_REVISION 111 +#define _VER_REVISION 112 #define _VER_SUFFIX #define _MB_VERSION ((_VER_MAJOR * 0x01000000) + (_VER_MINOR * 0x00010000) + (_VER_REVISION)) #define _STRINGIZE(A) _MAKE_STRINGIZE(A) @@ -4309,9 +4309,6 @@ void _gc_add(_ref_t* ref, void* data, _gc_t* gc) { if(gc && _ht_find(gc->collected_table, ref)) return; - if(ref->type == _DT_ARRAY) - return; - if(!ref->s->gc.table) return; @@ -4358,6 +4355,11 @@ int _gc_add_reachable(void* data, void* extra, void* ht) { if(!_ht_find(htable, &obj->data.usertype_ref->ref)) _ht_set_or_insert(htable, &obj->data.usertype_ref->ref, obj->data.usertype_ref); + break; + case _DT_ARRAY: + if(!_ht_find(htable, &obj->data.array->ref)) + _ht_set_or_insert(htable, &obj->data.array->ref, obj->data.array); + break; #ifdef MB_ENABLE_COLLECTION_LIB case _DT_LIST: