On Saturday, 3 September 2016 at 12:22:25 UTC, thedeemon wrote:
On Friday, 2 September 2016 at 14:55:26 UTC, jmh530 wrote:
Anyway, with @safe unions, my thinking is that it would mean that the garbage collector can be made precise in @safe code in a way that it can't in @system code (assuming unions with pointers aren't snuck in through @trusted).

GC (and runtime in general) has no idea what code is safe and what code is system. GC works with data at run-time. All @safe-related stuff is about code (not data!) and happens at compile-time. They are completely orthogonal and independent, as I understand.

This is correct, but when designing a GC – in particular, a precise GC –, having the compiler emit additional helpful metadata to binaries is always an option worth considering.

 — David

Reply via email to