diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-29 19:01:22 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-29 22:07:00 +1100 |
commit | 313f55905253697fe4966f979865296aeaa7a801 (patch) | |
tree | a8f060a377d45943952ade62507951cd4555a21b /src/lobject.js | |
parent | 62b07567d9f39fa746ea35d9c08cd1dcf37dc67a (diff) | |
download | fengari-313f55905253697fe4966f979865296aeaa7a801.tar.gz fengari-313f55905253697fe4966f979865296aeaa7a801.tar.bz2 fengari-313f55905253697fe4966f979865296aeaa7a801.zip |
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
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 6 |
1 files changed, 2 insertions, 4 deletions
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")); |