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
0f1969f1
Commit
0f1969f1
authored
Oct 04, 2019
by
Oran Agra
Browse files
trim the double implementation of jemalloc purge
parent
bf759cc9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/object.c
View file @
0f1969f1
...
...
@@ -1450,22 +1450,10 @@ NULL
addReplyVerbatim
(
c
,
report
,
sdslen
(
report
),
"txt"
);
sdsfree
(
report
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"purge"
)
&&
c
->
argc
==
2
)
{
#if defined(USE_JEMALLOC)
char
tmp
[
32
];
unsigned
narenas
=
0
;
size_t
sz
=
sizeof
(
unsigned
);
if
(
!
je_mallctl
(
"arenas.narenas"
,
&
narenas
,
&
sz
,
NULL
,
0
))
{
sprintf
(
tmp
,
"arena.%d.purge"
,
narenas
);
if
(
!
je_mallctl
(
tmp
,
NULL
,
0
,
NULL
,
0
))
{
if
(
jemalloc_purge
()
==
0
)
addReply
(
c
,
shared
.
ok
);
return
;
}
}
else
addReplyError
(
c
,
"Error purging dirty pages"
);
#else
addReply
(
c
,
shared
.
ok
);
/* Nothing to do for other allocators. */
#endif
}
else
{
addReplyErrorFormat
(
c
,
"Unknown subcommand or wrong number of arguments for '%s'. Try MEMORY HELP"
,
(
char
*
)
c
->
argv
[
1
]
->
ptr
);
}
...
...
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