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.