From 82f3e80e0622f67400a797322b57ba5956a473dc Mon Sep 17 00:00:00 2001 From: hong Date: Tue, 4 Jun 2019 19:42:01 +0800 Subject: [PATCH] =?UTF-8?q?collectref=E7=9A=84=E6=97=B6=E5=80=99=E5=87=8F?= =?UTF-8?q?=E5=B0=91nuse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rd/lua/lstring.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/3rd/lua/lstring.c b/3rd/lua/lstring.c index 92ecf584..3a646d04 100644 --- a/3rd/lua/lstring.c +++ b/3rd/lua/lstring.c @@ -524,11 +524,6 @@ exist(struct ssm_ref *r, TString *s) { return 0; } -static void -release_tstring(TString *s) { - DEC_SREF(s); -} - static int collectref(struct collect_queue * c) { int i; @@ -547,7 +542,8 @@ collectref(struct collect_queue * c) { if (s) { if (!exist(mark, s) && !exist(fix, s)) { save->hash[i] = NULL; - release_tstring(s); + --save->nuse; + DEC_SREF(s); ++total; } } @@ -557,8 +553,9 @@ collectref(struct collect_queue * c) { TString * s = save->array[i]; if (!exist(mark, s) && !exist(fix, s)) { --save->asize; + --save->nuse; save->array[i] = save->array[save->asize]; - release_tstring(s); + DEC_SREF(s); ++total; } else { ++i; @@ -569,13 +566,13 @@ collectref(struct collect_queue * c) { for (i=0;ihsize;i++) { TString * s = save->hash[i]; if (s) { - release_tstring(s); + DEC_SREF(s); ++total; } } for (i=0;iasize;i++) { TString * s = save->array[i]; - release_tstring(s); + DEC_SREF(s); ++total; } clear_vm(c);