forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (gnovm) star expr assign for gnolang#1919 (gnolang#2255)
This is a complete solution, alternative to gnolang#1919, and (I think) closes gnolang#1326. It creates a new container for "baseless" (floating) values constructed via `new(xxx)` or `&struct{}`, which currently do not have a base containing object for that value, and are currently represented as PointerValues with .Base set to nil. The containing object is like a Block but minimal -- it only contains one Value, and has no Source or Parent. The modifications to realm.go allow for proper ref-counting so that even when there are multiple references to the baseless value, and even when the value is primitive, gc and ref-counting works (since the containing HeapItemValue is ref-counted). PointerValue.Base should now never be nil. See also gnolang#1919 (comment) for why the previous solution doesn't work. A better optimization than the one mentioned in the comment above, is to always store the HeapItemValue along with the Value, since the Value's refcount should always be 1. This is left for the future, after first checking that this invariant is true. --------- Co-authored-by: deelawn <dboltz03@gmail.com>
- Loading branch information
Showing
31 changed files
with
1,820 additions
and
1,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.