From 313f55905253697fe4966f979865296aeaa7a801 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 Jan 2018 19:01:22 +1100 Subject: src/: Upvalues are now just TValues (possibly referencing on-stack) - Removes `Upval` class - closing over upvalues is now done by creating new on-stack TValue objects - No more `openupval` linked list With this fix, upvalues from collected coroutines will no longer keep other values alive Closes #44 --- src/lstate.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/lstate.js') diff --git a/src/lstate.js b/src/lstate.js index 461ad83..0c44f3c 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -18,7 +18,6 @@ const lobject = require('./lobject.js'); const ldo = require('./ldo.js'); const lapi = require('./lapi.js'); const ltable = require('./ltable.js'); -const lfunc = require('./lfunc.js'); const ltm = require('./ltm.js'); const EXTRA_STACK = 5; @@ -70,7 +69,6 @@ class lua_State { this.basehookcount = 0; this.allowhook = 1; this.hookcount = this.basehookcount; - this.openupval = null; this.nny = 1; this.status = LUA_OK; this.errfunc = 0; @@ -166,7 +164,6 @@ const lua_newthread = function(L) { }; const luaE_freethread = function(L, L1) { - lfunc.luaF_close(L1, L1.stack); freestack(L1); }; @@ -183,7 +180,6 @@ const lua_newstate = function() { }; const close_state = function(L) { - lfunc.luaF_close(L, L.stack); /* close all upvalues for this thread */ freestack(L); }; -- cgit v1.2.3-54-g00ecf