随笔分类 - C/C++
摘要:One of the problems with developing embedded systems is the detection of memory leaks; I've found three tools that are useful for this. These tools ar
阅读全文
摘要:原文链接:http://www.linuxjournal.com/article/6556?page=0,0 An earlier article [“Memory Leak Detection in Embedded Systems”, LJ, September 2002, available
阅读全文
摘要:以下测试基于的gcc版本: gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4Copyright (C) 2013 Free Software Foundation, Inc.This is free software; see the source for copyin
阅读全文
摘要:一直以来没分清什么时候该使用assert,什么时候该使用if。现在将其记录下来assert 用于检查参数的合法性以及某个预期的结果等,assert只在debug模式中在在。assert是面向程序员的,而不是面向用户,主要方便程序员能够检查及快速定位程序的逻辑错误(程序员自身带来的问题),如果在调试程...
阅读全文
摘要:为什么要使用inline函数?对于频繁被调用的小函数来说,每次调用都要保存当前寄存器,传递参数,以及结果后恢复之前的状态需要一定的开销。如果将其声明为inline,则在调用处会直接对其展开,由于函数较小,所以并不会对生成的二进制文件太大。将函数返回类型加上关键字inline就将函数指定为inline...
阅读全文

浙公网安备 33010602011771号