摘要:when I see the source code of memleak(a tool checking memory leak ), I find it's not efficient. So I rewrite it myself, I use a hash while the memleak use a list to manage the meta data.the following is my code :my_memleak.h#ifndef H_MY_MEMLEAK_H#define H_MY_MEMLAEK_H#include <stdlib.h>#in
阅读全文
摘要:在看redis源码的时候看到一个strcut sdshdr ,如下:struct sdshdr { int len; int free; char buf[];};代码中对于这个结构体的大小的处理挺奇怪的,试验一下,实验环境为VC6.0,求sizeof大小struct sdshdr { int len; int free; char *buf;};大小是12struct sdshdr { int len; int free; char buf[];};大小为8struct sdshdr { int len; int free; ...
阅读全文
摘要:安装过程见 :http://blog.csdn.net/a600423444/article/details/7203276自己写的一个测试代码,主要是set ,get和del功能#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <stdlib.h>#include "hiredis.h"static inline double micro_time(){ struct timeval tim; dou
阅读全文
摘要:Redis测试过程中的小问题总结 :1,如果想禁止数据写入磁盘,需要关注配置文件中的以下三项: (1)# after 60 sec if at least 10000 keys changed## Note: you can disable saving at all commenting all the "save" lines.save 900 1save 300 10save 60 10000上面的三个是触发同步到磁盘操作的条件,直接屏蔽即可(2)# IMPORTANT: Check the BGREWRITEAOF to check how to rewrite t
阅读全文
摘要:今天调试代码的时候运行后显示 段错误 (core dumped) 但是当前目录没有 ,查了资料发现如果代码中调用了chdir的话就很可能在该目录下,去找了下,果然在下面 :)PS: 说一个调试的小技巧 ,有时候代码有问题,但是不足以让程序崩溃,无法断定产生问题前的调用关系, 这个时候如果想主动的生成core 的话只需在该代码处人为的添加内存错误代码即可,如free(-1)。
阅读全文
摘要:自己安装时参考的资料,均来自网上Nginx安装和运行创建时间:2012年5月6日(星期天) 中午11:40|分类:未分类| 字数:2406|发送到我的Qzone|另存为...|打印|添加到日历Nginx安装和运行http://www.cnblogs.com/cenly/archive/2008/12/12/1353799.html官方网站http://wiki.codemongers.com/Main一、依赖的程序1. gzip module requires zlib library2. rewrite module requires pcre library3. ssl support r
阅读全文