Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
72324005
Commit
72324005
authored
Apr 22, 2010
by
antirez
Browse files
new units for bytes specification
parent
2b619329
Changes
2
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
72324005
...
@@ -989,17 +989,17 @@ static long long memtoll(const char *p, int *err) {
...
@@ -989,17 +989,17 @@ static long long memtoll(const char *p, int *err) {
while(*u && isdigit(*u)) u++;
while(*u && isdigit(*u)) u++;
if (*u == '\0' || !strcasecmp(u,"b")) {
if (*u == '\0' || !strcasecmp(u,"b")) {
mul = 1;
mul = 1;
} else if (!strcasecmp(u,"k")
|| !strcasecmp(u,"kb")
) {
} else if (!strcasecmp(u,"k")) {
mul = 1000;
mul = 1000;
} else if (!strcasecmp(u,"k
i") || !strcasecmp(u,"ki
b")) {
} else if (!strcasecmp(u,"kb")) {
mul = 1024;
mul = 1024;
} else if (!strcasecmp(u,"m")
|| !strcasecmp(u,"mb")
) {
} else if (!strcasecmp(u,"m")) {
mul = 1000*1000;
mul = 1000*1000;
} else if (!strcasecmp(u,"m
i") || !strcasecmp(u,"mi
b")) {
} else if (!strcasecmp(u,"mb")) {
mul = 1024*1024;
mul = 1024*1024;
} else if (!strcasecmp(u,"g")
|| !strcasecmp(u,"hb")
) {
} else if (!strcasecmp(u,"g")) {
mul = 1000L*1000*1000;
mul = 1000L*1000*1000;
} else if (!strcasecmp(u,"g
i") || !strcasecmp(u,"gi
b")) {
} else if (!strcasecmp(u,"gb")) {
mul = 1024L*1024*1024;
mul = 1024L*1024*1024;
} else {
} else {
if (err) *err = 1;
if (err) *err = 1;
...
...
redis.conf
View file @
72324005
# Redis configuration file example
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize
no
daemonize
no
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment