正在加载图片...
检测内存泄漏 B test1.c(-/calg/memchk)-gedit 文件(F)编辑(E)查看(M搜索(S)工具(T文档(D)帮助(H) 雪巴打开~保存台撤消 的國 test1.c x 1 #include <stdlib.h> 2 3 int main(void) 4 5 char *p malloc(10); 6 return EXIT_SUCCESS; 7 [wgsheng@calg memchk]$gcc test1.c -o test1 [wgsheng@calg memchk]$valgrind ./test1 ==3078==Memcheck,a memory error detector ==3078==Copyright (C)2002-2012,and GNU GPL'd,by Julian Seward et al. ==3078==Using Valgrind-3.8.1 and LibVEX;rerun with -h for copyright info ==3078== Command:./test1 ==3078== ==3078== ==3078==HEAP SUMMARY: ==3078== in use at exit:10 bytes in 1 blocks ==3078== total heap usage:1 allocs,0 frees,10 bytes allocated ==3078== ==3078==LEAK SUMMARY: 3078== definitely lost:10 bytes in 1 blocks ==3078== indirectly lost:0 bytes in 0 blocks =3078== possibly lost:0 bytes in 0 blocks ==3078== still reachable:0 bytes in 0 blocks ==3078== suppressed:0 bytes in 0 blocks ==3078==Rerun with --leak-check=full to see details of leaked memory ==3078== ==3078==For counts of detected and suppressed errors,rerun with:-v 画终端超Shel‖输出 C~跳格宽度:4行1,列20 插入检测内存泄漏 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有