On 05.12.14 21:55, Walter Bright wrote: > > It means that this code will be safe: > > void foo(scope int* p); > > p = malloc(n); > foo(p); > free(p); > > The rest is all the nuts and bolts of making that work. >
If it is main goal, opposite looks more natural. void foo(int* p); void foo1(escape int* p); p = malloc(n); p1 = malloc(n); foo(p); free(p); // OK foo1(p1); free(p1); // no