一,tcmalloc全称thread-cachingmalloc,是谷歌开发的开源工具。与标准的glibc库的malloc比。tcmalloc在内存分配效率和速度比malloc高。至于为什么比malloc,有兴趣可以参考。下面这个网址。http://www.mysqlops.com/2011/06/14/google-tcmalloc-malloc.html#more-737 二,现在开始介绍在64bitcentos6.3的版本中让nginx使用tcmalloc。需要用到的软件都已经上传到附件中。三,安装libunwind库。# tar xf libunwind-1.0.tar.gz # t
一,tcmalloc全称thread-cachingmalloc,是谷歌开发的开源工具。与标准的glibc库的malloc比。tcmalloc在内存分配效率和速度比malloc高。至于为什么比malloc,有兴趣可以参考。下面这个网址。http://www.mysqlops.com/2011/06/14/google-tcmalloc-malloc.html#more-737 二,现在开始介绍在64bitcentos6.3的版本中让nginx使用tcmalloc。需要用到的软件都已经上传到附件中。三,安装libunwind库。# tar xf libunwind-1.0.tar.gz # t
Bjarne在他的TheC++ProgrammingLanguage里面给出过一个助记的方法:把一个声明从右向左读。char*constcp;(*读成pointerto)cpisaconstpointertocharconstchar*p;pisapointertoconstchar;charconst*p;同上因为C++里面没有const*的运算符,所以const只能属于前面的类型。C++标准规定,const关键字放在类型或变量名之前等价的。constintn=5;//sameasbelowintconstm=10;constint*p;//sameasbelowconst(int)*pin
Bjarne在他的TheC++ProgrammingLanguage里面给出过一个助记的方法:把一个声明从右向左读。char*constcp;(*读成pointerto)cpisaconstpointertocharconstchar*p;pisapointertoconstchar;charconst*p;同上因为C++里面没有const*的运算符,所以const只能属于前面的类型。C++标准规定,const关键字放在类型或变量名之前等价的。constintn=5;//sameasbelowintconstm=10;constint*p;//sameasbelowconst(int)*pin