diff --git a/HISTORY b/HISTORY index 61f86e5..56dd122 100755 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,5 @@ Apr. 26 2016 -Added an invalid operation usage error when met unexpected expression +Added an invalid operation usage error when met an unexpected expression Apr. 22 2016 Added UTF8 token support diff --git a/core/my_basic.c b/core/my_basic.c index 00ae53a..4063a67 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -344,6 +344,7 @@ typedef void (* _unref_func_t)(struct _ref_t*, void*); typedef unsigned _ref_count_t; +/* The reference structure should be always at the head of an object */ typedef struct _ref_t { _ref_count_t* count; _ref_count_t* weak_count; @@ -6093,9 +6094,8 @@ static void _init_array(_array_t* arr) { mb_assert(arr->count > 0); mb_assert(!arr->raw); arr->raw = (void*)mb_malloc(elemsize * arr->count); - if(arr->raw) { + if(arr->raw) memset(arr->raw, 0, elemsize * arr->count); - } #ifndef MB_SIMPLE_ARRAY arr->types = (_data_e*)mb_malloc(sizeof(_data_e) * arr->count); if(arr->types) {