[Issue 19316] GC runtime breaks @safe and pure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 13 21:46:58 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=19316

Steven Schveighoffer <schveiguy at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |schveiguy at gmail.com
         Resolution|---                         |INVALID

--- Comment #3 from Steven Schveighoffer <schveiguy at gmail.com> ---
The GC's finalizer execution should not be treated as being called via the
allocation. It can be thought of as the GC hijacking the thread's call stack to
run the finalizers independent of the safe function (or pure function, or
whatever else is restricted). You can imagine the finalizers running in a
separate thread completely (which actually could be implemented), and then the
"problem" in this bug is eliminated, but doesn't change semantics at all.

In fact, at that point, any pure or safe function could call an impure or
unsafe finalizer because the OS has interrupted that thread with a signal.

This bug is invalid.

--


More information about the Digitalmars-d-bugs mailing list