What should happen here?
Ali Çehreli
acehreli at yahoo.com
Wed Sep 22 18:30:41 UTC 2021
On 9/22/21 11:16 AM, Johan wrote:
> besides an intrinsic to tell the optimizer to keep that pointer
> value alive in some storage that is scanned by GC (reachable memory or
> registers).
Nobody seems to see the violation of "lifetime being the length of the
scope" being a problem here. (You mentioned it elsewhere in this
thread.) I think this is because the same issue is present in other
languages.
Shouldn't preserving the contents of registers be the responsibility of
the compiler or the GC? And perhaps the compiler should skip that
optimization if the contents cannot be preserved?
Ali
More information about the Digitalmars-d
mailing list