This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue 18996 - ProtoGC should support removing roots and ranges
that were not originally added. Behavior is now consistent with conservative GC.
- Loading branch information
Showing
3 changed files
with
14 additions
and
3 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
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,13 @@ | ||
// Issue https://issues.dlang.org/show_bug.cgi?id=18996 | ||
// Array!string calls removeRange without first adding the range, but never | ||
// initializes the GC. The behavior of the default GC is to ignore removing | ||
// ranges when the range wasn't added. The ProtoGC originally would crash when | ||
// this happened. | ||
|
||
import core.memory; | ||
|
||
void main() | ||
{ | ||
GC.removeRange(null); | ||
GC.removeRoot(null); | ||
} |