Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xindoo
redis
提交
c5166e3f
R
redis
项目概览
xindoo
/
redis
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c5166e3f
编写于
3月 16, 2012
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
First implementation of --test-memory. Still a work in progress.
上级
c9d3dda2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
2 deletion
+16
-2
src/Makefile
src/Makefile
+1
-1
src/redis.c
src/redis.c
+15
-1
未找到文件。
src/Makefile
浏览文件 @
c5166e3f
...
...
@@ -73,7 +73,7 @@ QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR
QUIET_LINK
=
@printf
' %b %b\n'
$(LINKCOLOR)
LINK
$(ENDCOLOR)
$(BINCOLOR)$@$(ENDCOLOR)
;
endif
OBJ
=
adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o
OBJ
=
adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o
memtest.o
BENCHOBJ
=
ae.o anet.o redis-benchmark.o sds.o adlist.o zmalloc.o
CLIOBJ
=
anet.o sds.o adlist.o redis-cli.o zmalloc.o release.o
CHECKDUMPOBJ
=
redis-check-dump.o lzf_c.o lzf_d.o
...
...
src/redis.c
浏览文件 @
c5166e3f
...
...
@@ -2231,7 +2231,8 @@ void usage() {
fprintf
(
stderr
,
"Usage: ./redis-server [/path/to/redis.conf] [options]
\n
"
);
fprintf
(
stderr
,
" ./redis-server - (read config from stdin)
\n
"
);
fprintf
(
stderr
,
" ./redis-server -v or --version
\n
"
);
fprintf
(
stderr
,
" ./redis-server -h or --help
\n\n
"
);
fprintf
(
stderr
,
" ./redis-server -h or --help
\n
"
);
fprintf
(
stderr
,
" ./redis-server --test-memory <megabytes>
\n\n
"
);
fprintf
(
stderr
,
"Examples:
\n
"
);
fprintf
(
stderr
,
" ./redis-server (run the server with default conf)
\n
"
);
fprintf
(
stderr
,
" ./redis-server /etc/redis/6379.conf
\n
"
);
...
...
@@ -2287,6 +2288,8 @@ void setupSignalHandlers(void) {
return
;
}
void
memtest
(
size_t
megabytes
,
int
passes
);
int
main
(
int
argc
,
char
**
argv
)
{
long
long
start
;
struct
timeval
tv
;
...
...
@@ -2308,6 +2311,17 @@ int main(int argc, char **argv) {
strcmp
(
argv
[
1
],
"--version"
)
==
0
)
version
();
if
(
strcmp
(
argv
[
1
],
"--help"
)
==
0
||
strcmp
(
argv
[
1
],
"-h"
)
==
0
)
usage
();
if
(
strcmp
(
argv
[
1
],
"--test-memory"
)
==
0
)
{
if
(
argc
==
3
)
{
memtest
(
atoi
(
argv
[
2
]),
10000
);
exit
(
0
);
}
else
{
fprintf
(
stderr
,
"Please specify the amount of memory to test in megabytes.
\n
"
);
fprintf
(
stderr
,
"Example: ./redis-server --test-memory 4096
\n\n
"
);
exit
(
1
);
}
}
/* First argument is the config file name? */
if
(
argv
[
j
][
0
]
!=
'-'
||
argv
[
j
][
1
]
!=
'-'
)
configfile
=
argv
[
j
++
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录