瀏覽代碼

Print the amount of memory allocated using k/M/G bytes

master
Ian Piumarta 4 年之前
父節點
當前提交
3886b9c623
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      parse.leg

+ 4
- 1
parse.leg 查看文件

@ -1988,7 +1988,10 @@ int main(int argc, char **argv)
readEvalPrint(globals, NULL);
}
printf("[GC: %lli bytes allocated]\n", nalloc);
if (nalloc < 1024) printf("[GC: %lli bytes allocated]\n", nalloc );
else if (nalloc < 1024*1024) printf("[GC: %lli kB allocated]\n", nalloc / 1024 );
else if (nalloc < 1024*1024*1024) printf("[GC: %.2f MB allocated]\n", (double)nalloc / ( 1024*1024));
else printf("[GC: %.2f GB allocated]\n", (double)nalloc / (1024*1024*1024));
return 0;

Loading…
取消
儲存