d中简单禁止垃集
{
    import core.memory: GC;
    GC.disable();
    scope(exit) GC.enable();
    foreach (...)
        // 热代码.
}
void load_assets()
{
    import core.memory: GC;
    // 分配,加载等.
    GC.collect();
}
如今,添加新属性到core.attribute模块中,而不是全局可用,因此如果要加@GC(...)语法,还需要导入.😃
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号