This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2440 from rainers/gc_cleanup
GC cleanup can now be configured as a DRT GC option
- Loading branch information
Showing
3 changed files
with
55 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
GC cleanup can now be configured as a DRT GC option | ||
|
||
The default cleanup method for the GC is to unconditionally run a | ||
collection before runtime termination to finalize objects | ||
that are still alive and hold resources that affect system state outside | ||
the current process. This combines the worst of possible alternatives: | ||
it can cause a considerable delay and does not guarantee finalization | ||
of all objects as roots might still exist. | ||
|
||
The cleanup behaviour can now be configured by a DRT option to the | ||
$(LINK2 $(ROOT_DIR)spec/garbage.html, GC configuration), | ||
e.g. by passing `--DRT-gcopt=cleanup:none` on the command | ||
line. Three options are provided: | ||
|
||
$(UL | ||
$(LI collect: run a collection (the default for backward compatibility)) | ||
$(LI none: do nothing) | ||
$(LI finalize: all live objects are finalized unconditionally) | ||
) | ||
|
||
As usual, you can also embed the configuration into the application by | ||
redefining `rt_options`, e.g. | ||
|
||
------- | ||
extern(C) __gshared string[] rt_options = [ "gcopt=cleanup:none" ]; | ||
------- |
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