摘要: TCMalloc(Thread-Caching Malloc)是google开发的开源工具“google-perftools”中的成员。与标准的glibc库的malloc相比,TCMalloc在内存的分配上效率和速度要高得多,可以在很大程度上提高服务器在高并发情况下的性能,降低系统负载。译文:http://shiningray.cn/tcmalloc-thread-caching-malloc.html原文:http://goog-perftools.sourceforge.net/doc/tcmalloc.html使用经验http://wenku.baidu.com/view/7486b55 阅读全文
posted @ 2011-07-27 12:32 edwardlost 阅读(710) 评论(0) 推荐(0) 编辑
摘要: 代码编译# 在调试代码时不要打开编译器优化选项$ gcc -g3 -Wall -Wextra -o test1 test1.c# 完成调试后才使用优化选项$ gcc -O9 -g3 -Wall -Wextra -o test1 test1.cStartup Files~/.gdbinit./.gdbinit通过参数指定 startup file$ gdb -command=z-file x启动GDB开启TUI (Terminal User Interface)界面$ gdb -tui HegemonyTextLivectrl-p 前一个命令ctrl-n 后一个命令# 调试正在运行中的程序,指定 阅读全文
posted @ 2011-07-27 12:07 edwardlost 阅读(1095) 评论(0) 推荐(0) 编辑
摘要: 【Warning 选项】详细查阅GCC手册:http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Warning-Options.html#Warning-Options-Wall显示关键类别的警告信息。-Wextra显示额外的警告信息,没有包含在-Wall中的;该选项原来被称为-W,目前仍然有效,但建议使用新名称。-Werror将警告视为错误处理,即在警告发生时终止编译。【宏处理】查看gcc预定义的宏,这些宏名称都是以'__'为前缀的$ cpp -dM /dev/null#define __i386__ 1#define __i386 1#d 阅读全文
posted @ 2011-07-27 10:27 edwardlost 阅读(472) 评论(0) 推荐(0) 编辑