-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for SI-6706, Symbol breakage under GC.
Ensure the map key and the String in the Symbol are the same reference by removing the old key before updating the map with the new key -> symbol relation.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
object Test { | ||
var name = "foo" + 1 | ||
var s1 = Symbol(name) | ||
s1 = null | ||
System.gc | ||
val s2 = Symbol("foo1") | ||
name = null | ||
System.gc | ||
val s3 = Symbol("foo1") | ||
|
||
def main(args: Array[String]): Unit = { | ||
assert(s2 eq s3, ((s2, System.identityHashCode(s2), s3, System.identityHashCode(s3)))) | ||
} | ||
} |