On Tuesday, 15 April 2014 at 19:12:30 UTC, Steven Schveighoffer wrote:
int isthisok(int x, int y) @nogc
{
   // need scratch space
   int[] buf = new int[x * y];
   scope(exit) GC.free(buf.ptr);
   // perform some algorithm using buf
   ...
   //
   return buf[$-1];
}

Valid?

No way. This can trigger GC collection. @nogc is not about observable pre- and post- state but about prohibiting specific operation completely.

Reply via email to