Skip to content

Commit

Permalink
Merge pull request #1492 from schveiguy/cycleswitch
Browse files Browse the repository at this point in the history
Changelog for new cycle detection behavior switches.
  • Loading branch information
MartinNowak committed Oct 8, 2016
2 parents 6c63ab2 + b14c0c8 commit afe70f3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions changelog/2.072.0_pre.dd
Expand Up @@ -108,6 +108,8 @@ $(BUGSTITLE Library Changes,
$(LI $(RELATIVE_LINK2 emplace-inner-class, `std.conv.emplace` no longer allows
to emplace classes directly nested inside other classes without specifying a
suitable `outer` pointer))
$(LI $(RELATIVE_LINK2 drt-oncycle, New druntime switch `--DRT-oncycle`
allows specifying what to do on cycle detection in modules.))
)

$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))
Expand Down Expand Up @@ -730,6 +732,19 @@ $(BUGSTITLE Library Changes,
// now it works as expected
-------
)

$(LI $(LNAME2 drt-oncycle, New druntime switch `--DRT-oncycle` allows
specifying what to do on cycle detection in modules.)
$(P When module cycles are detected, the default behavior is to print the cycle, and abort execution. However, in many cases, the cycles are not harmful. With the new `--DRT-oncycle` switch, you can effect a different behavior when cycles are detected:)
$(DL
$(DT `--DRT-oncycle=abort`)
$(DD This is the default behavior, and will abort, printing the cycle to `stderr` when the first cycle is detected)
$(DT `--DRT-oncycle=print`)
$(DD Print all cycles that are detected to `stderr`, but do not halt execution. Order of initialization is arbitrarily chosen based on the order the modules are in the binary)
$(DT `--DRT-oncycle=ignore`)
$(DD Do not print anything, and do not halt execution. Order of initialization is arbitrarily chosen based on the order the modules are in the binary)
)
)
)
)

Expand Down
16 changes: 16 additions & 0 deletions spec/module.dd
Expand Up @@ -542,6 +542,22 @@ $(H3 $(LNAME2 order_of_static_ctor, Order of Static Construction))
in a runtime exception.
)

$(H3 $(LNAME2 override_cycle_abort, Overriding Cycle Detection Abort))

$(P You can override the cyclic detection behavior using the D Runtime
switch `--DRT-oncycle=...` The following behaviors are supported:
)

$(OL
$(LI `abort` The default behavior.)
$(LI `print` Print all cycles detected, but do not abort execution.
Order of static construction is implementation defined, and not
guaranteed to be valid.)
$(LI `ignore` Do not abort execution or print any cycles. Order of
static construction is implementation defined, and not guaranteed
to be valid.)
)

$(H3 $(LNAME2 order_of_static_ctors, Order of Static Construction within a Module))

Within a module, the static construction occurs in the lexical
Expand Down

0 comments on commit afe70f3

Please sign in to comment.