摘要: 参照:https://zcheng.ren/sourcecodeanalysis/theannotatedredissourcesds/#sds%E5%B0%8F%E7%BB%93 这里用char buf[] 而不用char* buf 的原因是方便内存释放 阅读全文
posted @ 2019-09-30 20:28 water_bear 阅读(121) 评论(0) 推荐(0)
摘要: 文件:zmoalloc.h zmoalloc.c 1.求两个整数的余数 eg: 求_n对sizeof(long)的余数(_n&(sizeof(long)-1)), 性能提升为50%~100% 左右。 阅读全文
posted @ 2019-09-27 21:14 water_bear 阅读(165) 评论(0) 推荐(0)
摘要: https://github.com/antirez/redis http://try.redis.io/ http://www.redis.cn/documentation.html https://redissrc.readthedocs.io/en/latest/#id3 https://ww 阅读全文
posted @ 2019-09-26 20:53 water_bear 阅读(195) 评论(0) 推荐(0)
摘要: #include <memory> #include <array> #include <string> template<typename Functor> class TrieNode { public: TrieNode(): m_is_end(false), m_pfun(nullptr), 阅读全文
posted @ 2019-09-12 20:26 water_bear 阅读(130) 评论(0) 推荐(0)
摘要: https://github.com/paudley/lru_cache 阅读全文
posted @ 2019-09-12 18:05 water_bear 阅读(88) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2019-08-23 09:07 water_bear 阅读(4) 评论(0) 推荐(0)
摘要: 参考:https://www.jianshu.com/p/01601515ca31 《大规模C++程序设计》 函数接口: 1.运算符或非运算符函数? 2.自由或成员运算符? 3.虚函数或非虚函数? 4.纯虚成员函数或非纯虚成员函数? 5.静态或非静态成员函数? 6.const 或非const 成员函 阅读全文
posted @ 2019-08-22 08:57 water_bear 阅读(207) 评论(0) 推荐(0)
摘要: 计算机书籍控 http://bestcbooks.com/recommend/most-influential-book/ 阅读全文
posted @ 2019-08-09 09:18 water_bear 阅读(157) 评论(0) 推荐(0)
摘要: 1.线程池,共享线程安全队列 例子:osmium thread 模块 thread_safe_queue<task> =>work thread1 => ... thread_safe_queue<result> =>work thread n => 2.使用双buffer无锁化 例子:http:/ 阅读全文
posted @ 2019-07-25 22:01 water_bear 阅读(185) 评论(0) 推荐(0)
摘要: 1.代理模式 2.模版 3.NVI(non-virtual interface) 参考:https://www.cnblogs.com/qicosmos/p/4772389.html 《effective C++》条款35:考虑virtual函数以外的其他选择 阅读全文
posted @ 2019-07-25 09:09 water_bear 阅读(421) 评论(0) 推荐(0)