On Thursday, 5 June 2014 at 19:27:56 UTC, Steven Schveighoffer wrote:
On Thu, 05 Jun 2014 14:47:54 -0400, deadalnix
T[] arr = [ ... ];
arr = arr[$ .. $];
auto garbage = *(arr.ptr);

Believe it or not, this is actually safe.

-Steve

What do you mean by "is actually safe" ? In the "can you actually believe this obviously wrong code is marked as safe" or "this code that looks wrong is actually perfectly safe"?

AFAIK, it's only safe if arr is GC allocated to a bloc smaller than a page, so the conditions are implementation defined behavior, and so is the result.

Reply via email to