岚天逸见

上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 77 下一页

2015年10月26日 #

CMake使用技巧集

摘要: 1、注意CMake不允许出现相同的目标名称,即使是不同的目录下的CMakeLists.txt2、将头文件搜索路径插入到其它的前面:include_directories(BEFORE /tmp)当使用CMake的include复用规则时,如果想让某头文件路径至于其它的... 阅读全文

posted @ 2015-10-26 15:32 岚天逸见 阅读(292) 评论(0) 推荐(0)

2015年10月20日 #

编译期强制函数参数为字符串常量

摘要: 设计一函数f(),使用得下面代码中的第一个f()调用可正常编译,而其它编译报错#include #include int main(){ f("hello"); // 正常编译通过 const char* str1 = "hello"; f(... 阅读全文

posted @ 2015-10-20 17:44 岚天逸见 阅读(232) 评论(0) 推荐(0)

2015年10月9日 #

arean.c

摘要: glibc-2.14中的arean.c源代码,供研究malloc和free实现使用:/* Malloc implementation for multiple threads without lock contention. Copyright (C) 2001,... 阅读全文

posted @ 2015-10-09 15:48 岚天逸见 阅读(182) 评论(0) 推荐(0)

malloc.c

摘要: glibc-2.14中的malloc.c源代码,供研究malloc和free实现使用:/* Malloc implementation for multiple threads without lock contention. Copyright (C) 1996... 阅读全文

posted @ 2015-10-09 15:46 岚天逸见 阅读(721) 评论(0) 推荐(0)

__lll_mutex_lock_wait的错误原因

摘要: 1. x86_64栈(glib 2.4):free时:(gdb) bt#0 0x00002b9405ea1c38 in __lll_mutex_lock_wait () from /lib64/libc.so.6#1 0x00002b9405e45e5f in _... 阅读全文

posted @ 2015-10-09 15:35 岚天逸见 阅读(439) 评论(0) 推荐(0)

2015年9月25日 #

rapidjson常见使用示例

摘要: rapidjson相比jsoncpp性能高出太多,使用接口一样的简单的。官方中文帮助文档:http://rapidjson.org/zh-cn/。rapidjson的Move语意,请浏览http://rapidjson.org/zh-cn/md_doc_tutoria... 阅读全文

posted @ 2015-09-25 19:19 岚天逸见 阅读(8613) 评论(0) 推荐(0)

2015年9月22日 #

如何取得nginx做反向代理时的真实IP?

摘要: 1. 编译对于client -> nginx reverse proxy -> apache,要想在程序中取得真实的IP,在执行nginx的configure时,必须指定参数“--with-http_realip_module”,示例:./configure --pr... 阅读全文

posted @ 2015-09-22 18:10 岚天逸见 阅读(461) 评论(0) 推荐(0)

2015年9月19日 #

程序员不常用Linux命令集

摘要: 1) 关闭指定网卡,如关闭网卡eth0ifconfig eth0 down也可以使用ifdown,通常ifdown是一个指向ifup的软链接,而ifup为一个脚本文件。2) 命令自启动,如希望机器重启时自动关闭网卡eth0这个只需要在文件/etc/rc.d/rc.lo... 阅读全文

posted @ 2015-09-19 11:08 岚天逸见 阅读(189) 评论(0) 推荐(0)

2015年9月18日 #

再议GCC编译时的静态库依赖次顺问题

摘要: 假设有如三个源代码文件:$ cat a.cppvoid a(){} $ cat b.cppextern void a();void b(){ a(); // 调用a.cpp中的a()} $ cat x.cppextern void b();int main(){... 阅读全文

posted @ 2015-09-18 15:49 岚天逸见 阅读(887) 评论(0) 推荐(0)

2015年9月15日 #

pthread_rwlock_rdlock和“No such file or directory”

摘要: pthread_rwlock_rdlock和“No such file or directory”调用pthread_rwlock_rdlock时,如果失败报错“pthread_rwlock_rdlock”,则可能是因为对同一把锁先加了写锁,再加读锁时就报这个错误了。... 阅读全文

posted @ 2015-09-15 17:38 岚天逸见 阅读(351) 评论(0) 推荐(0)

上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 77 下一页

导航