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/lobject.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lobject.js') diff --git a/src/lobject.js b/src/lobject.js index 34d8550..055ccb2 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -48,7 +48,6 @@ const { } = require('./ljstype.js'); const ldebug = require('./ldebug.js'); const ldo = require('./ldo.js'); -const lfunc = require('./lfunc.js'); const lstate = require('./lstate.js'); const { luaS_bless, @@ -301,7 +300,7 @@ class LClosure { this.p = null; this.nupvalues = n; - this.upvals = new Array(n); /* list of upvalues as UpVals. initialised in luaF_initupvals */ + this.upvals = new Array(n); /* list of upvalues. initialised in luaF_initupvals */ } } @@ -656,8 +655,7 @@ const luaO_pushvfstring = function(L, fmt, argp) { v instanceof ltable.Table || v instanceof Udata || v instanceof LClosure || - v instanceof CClosure || - v instanceof lfunc.UpVal) { + v instanceof CClosure) { pushstr(L, to_luastring("0x"+v.id.toString(16))); } else if (v === null) { /* handle null before checking for typeof == object */ pushstr(L, to_luastring("null")); -- cgit v1.2.3-54-g00ecf