安全的 D.
一旦 a 引用的内存不再通过程序中的任何变量引用,垃圾收集器将释放其内存。
除了标记为 @safe 的代码外,D 还允许指针运算。
void safeFun() @safe
{
    writeln("Hello World");
    // allocating memory with the GC is safe too
    int* p = new int;
}
void unsafeFun()
{
    int* p = new int;
    int* fiddling = p + 5;
}
void main()
{
    safeFun();
    unsafeFun();
}
有关 SafeD 的更多信息,请参阅 D 设计团队的文章 。