![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
gongchenwei
这个作者很懒,什么都没留下…
展开
-
Linux C 编程内存泄露检测工具(一):mtrace
前言所有使用动态内存分配(dynamic memory allocation)的程序都有机会遇上内存泄露(memory leakage)问题,在Linux里有三种常用工具来检测内存泄露的情況,包括:mtracedmallocmemwatch1. mtracemtrace是三款工具之中是最简单易用的,mtrace是一个C函數,在里声明及定义,函数原型为: void mtrace(void);其实mtrace是类似malloc_hook的malloc handler,只不过mtrace的handler转载 2010-11-03 13:14:00 · 352 阅读 · 0 评论 -
Linux C 编程内存泄露检测工具(二):memwatch
Memwatch简介<br />在三种检测工具当中,设置最简单的算是memwatch,和dmalloc一样,它能检测未释放的内存、同一段内存被释放多次、位址存取错误及不当使用未分配之内存区域。请往http://www.linkdata.se/sourcecode.html下载最新版本的Memwatch。安装及使用memwatch<br />很幸运地,memwatch根本是不需要安装的,因为它只是一组C程序代码,只要在你程序中加入memwatch.h,编译时加上-DMEMWATCH -DMW_STDIO及转载 2010-11-03 13:15:00 · 330 阅读 · 0 评论 -
implicit declaration of function '...' 的warning
用gcc编译c程序的时候 经常会出现implicit declaration of function '...' 的warning 1 没有把函数所在的c文件生成.o目标文件;2 在函数所在的c文件中声明了,但是没有在调用它的.h或.c文件中声明;3 其头文件都声明过了,所调用的函数的原型与所传的实参类型不匹配.转载 2010-11-05 13:29:00 · 684 阅读 · 0 评论 -
exception handing (I)
<br />Exception handing in program can connect the unexpected events to higher exections context, it's able to recover from the abnormal events better.<br /> <br />C++ could specify whether or a function could throw exceptions too.void MyFunc() throw(...)原创 2011-01-31 15:36:00 · 393 阅读 · 0 评论