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
d428de59
Unverified
Commit
d428de59
authored
Nov 08, 2020
by
David CARLIER
Committed by
GitHub
Nov 08, 2020
Browse files
DragonFlyBSD resident memory amount (almost) similar as FreeBSD. (#8023)
parent
cd1c6005
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/zmalloc.c
View file @
d428de59
...
@@ -365,7 +365,7 @@ size_t zmalloc_get_rss(void) {
...
@@ -365,7 +365,7 @@ size_t zmalloc_get_rss(void) {
return
t_info
.
resident_size
;
return
t_info
.
resident_size
;
}
}
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__)
|| defined(__DragonFly__)
#include <sys/types.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <sys/user.h>
...
@@ -381,7 +381,11 @@ size_t zmalloc_get_rss(void) {
...
@@ -381,7 +381,11 @@ size_t zmalloc_get_rss(void) {
mib
[
3
]
=
getpid
();
mib
[
3
]
=
getpid
();
if
(
sysctl
(
mib
,
4
,
&
info
,
&
infolen
,
NULL
,
0
)
==
0
)
if
(
sysctl
(
mib
,
4
,
&
info
,
&
infolen
,
NULL
,
0
)
==
0
)
#if defined(__FreeBSD__)
return
(
size_t
)
info
.
ki_rssize
;
return
(
size_t
)
info
.
ki_rssize
;
#else
return
(
size_t
)
info
.
kp_vm_rssize
;
#endif
return
0L
;
return
0L
;
}
}
...
...
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