Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
260cfcf7
Commit
260cfcf7
authored
Feb 04, 2015
by
Chris Lamb
Committed by
antirez
Feb 12, 2015
Browse files
Support "1G" etc. units in CONFIG SET maxmemory
Signed-off-by:
Chris Lamb
<
chris@chris-lamb.co.uk
>
parent
967590de
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
260cfcf7
...
@@ -628,8 +628,9 @@ void configSetCommand(redisClient *c) {
...
@@ -628,8 +628,9 @@ void configSetCommand(redisClient *c) {
zfree
(
server
.
masterauth
);
zfree
(
server
.
masterauth
);
server
.
masterauth
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
server
.
masterauth
=
((
char
*
)
o
->
ptr
)[
0
]
?
zstrdup
(
o
->
ptr
)
:
NULL
;
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxmemory"
))
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
2
]
->
ptr
,
"maxmemory"
))
{
if
(
getLongLongFromObject
(
o
,
&
ll
)
==
REDIS_ERR
||
int
err
;
ll
<
0
)
goto
badfmt
;
ll
=
memtoll
(
o
->
ptr
,
&
err
);
if
(
err
||
ll
<
0
)
goto
badfmt
;
server
.
maxmemory
=
ll
;
server
.
maxmemory
=
ll
;
if
(
server
.
maxmemory
)
{
if
(
server
.
maxmemory
)
{
if
(
server
.
maxmemory
<
zmalloc_used_memory
())
{
if
(
server
.
maxmemory
<
zmalloc_used_memory
())
{
...
...
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