[Dlang-internal] DIP1000 discussion and testing

Martin Nowak via Dlang-internal dlang-internal at puremagic.com
Sat Oct 29 03:49:04 PDT 2016


On Saturday, 22 October 2016 at 08:10:51 UTC, Walter Bright wrote:
> On 10/21/2016 8:38 AM, Dicebot wrote:
>    int foo(scope Unique u);
>
> it is guaranteed that u's value does not escape from foo(). So,
>
>    Unique u = malloc();
>    foo(u);
>    free(u); // guaranteed to not leave a dangling pointer

That's unsafe code calling safe code, but the more relevant case 
is safe code interfacing with trusted code.


More information about the Dlang-internal mailing list