这个最小的程序:
int main()
{
return 0;
}
当使用 valgrind 编译gcc
和运行时工作得很好。
编译为 D 程序时使用
dmd test_new.d && valgrind ./test_new
我得到:
HEAP SUMMARY:
in use at exit: 360 bytes in 4 blocks
total heap usage: 22 allocs, 18 frees, 52,024 bytes allocated
LEAK SUMMARY:
definitely lost: 288 bytes in 3 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 72 bytes in 1 blocks
suppressed: 0 bytes in 0 blocks
使用 gdc:
gdc -o test_new test_new.d && valgrind ./test_new
我明白了
HEAP SUMMARY:
in use at exit: 568 bytes in 4 blocks
total heap usage: 23 allocs, 19 frees, 52,664 bytes allocated
LEAK SUMMARY:
definitely lost: 496 bytes in 3 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 72 bytes in 1 blocks
suppressed: 0 bytes in 0 blocks
这里有什么问题?