JavaScript中的GC
It has been 1194 days since the last update, the content of the article may be outdated.
js
1 | const f = function () { |
在调用f().c()
以后,f没有被其他资源,被立即释放,即f().c()
以后被GC;
如何才能不被自动GC:
js
1 | let o = f(); |
如何手动释放:
js
1 | o = null; |
评论
TwikooValine
1 | const f = function () { |
在调用f().c()
以后,f没有被其他资源,被立即释放,即f().c()
以后被GC;
如何才能不被自动GC:
1 | let o = f(); |
如何手动释放:
1 | o = null; |