mirror of
https://github.com/jemalloc/jemalloc
synced 2026-06-08 15:01:07 +00:00
Wrap mallctl* references with JEMALLOC_P().
This commit is contained in:
+28
-19
@@ -429,24 +429,33 @@ stats_print(void (*write4)(void *, const char *, const char *, const char *,
|
||||
"\n", "");
|
||||
|
||||
write4(w4opaque, "Boolean JEMALLOC_OPTIONS: ", "", "", "");
|
||||
if ((err = mallctl("opt.abort", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.abort", &bv, &bsz, NULL, 0))
|
||||
== 0)
|
||||
write4(w4opaque, bv ? "A" : "a", "", "", "");
|
||||
if ((err = mallctl("opt.prof", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.prof", &bv, &bsz, NULL, 0))
|
||||
== 0)
|
||||
write4(w4opaque, bv ? "F" : "f", "", "", "");
|
||||
if ((err = mallctl("opt.junk", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.junk", &bv, &bsz, NULL, 0))
|
||||
== 0)
|
||||
write4(w4opaque, bv ? "J" : "j", "", "", "");
|
||||
if ((err = mallctl("opt.prof_leak", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.prof_leak", &bv, &bsz, NULL,
|
||||
0)) == 0)
|
||||
write4(w4opaque, bv ? "L" : "l", "", "", "");
|
||||
if ((err = mallctl("opt.overcommit", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.overcommit", &bv, &bsz,
|
||||
NULL, 0)) == 0)
|
||||
write4(w4opaque, bv ? "O" : "o", "", "", "");
|
||||
write4(w4opaque, "P", "", "", "");
|
||||
if ((err = mallctl("opt.prof_udump", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.prof_udump", &bv, &bsz,
|
||||
NULL, 0)) == 0)
|
||||
write4(w4opaque, bv ? "U" : "u", "", "", "");
|
||||
if ((err = mallctl("opt.sysv", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.sysv", &bv, &bsz, NULL, 0))
|
||||
== 0)
|
||||
write4(w4opaque, bv ? "V" : "v", "", "", "");
|
||||
if ((err = mallctl("opt.xmalloc", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.xmalloc", &bv, &bsz, NULL,
|
||||
0)) == 0)
|
||||
write4(w4opaque, bv ? "X" : "x", "", "", "");
|
||||
if ((err = mallctl("opt.zero", &bv, &bsz, NULL, 0)) == 0)
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.zero", &bv, &bsz, NULL, 0))
|
||||
== 0)
|
||||
write4(w4opaque, bv ? "Z" : "z", "", "", "");
|
||||
write4(w4opaque, "\n", "", "", "");
|
||||
|
||||
@@ -473,8 +482,8 @@ stats_print(void (*write4)(void *, const char *, const char *, const char *,
|
||||
write4(w4opaque, "Medium spacing: ", umax2s(sv, 10, s), "\n",
|
||||
"");
|
||||
|
||||
if ((err = mallctl("arenas.tspace_min", &sv, &ssz, NULL, 0)) ==
|
||||
0) {
|
||||
if ((err = JEMALLOC_P(mallctl)("arenas.tspace_min", &sv, &ssz,
|
||||
NULL, 0)) == 0) {
|
||||
write4(w4opaque, "Tiny 2^n-spaced sizes: [", umax2s(sv,
|
||||
10, s), "..", "");
|
||||
|
||||
@@ -516,8 +525,8 @@ stats_print(void (*write4)(void *, const char *, const char *, const char *,
|
||||
"Min active:dirty page ratio per arena: N/A\n", "",
|
||||
"", "");
|
||||
}
|
||||
if ((err = mallctl("opt.lg_tcache_nslots", &sv, &ssz, NULL, 0))
|
||||
== 0) {
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.lg_tcache_nslots", &sv,
|
||||
&ssz, NULL, 0)) == 0) {
|
||||
size_t tcache_nslots, tcache_gc_sweep;
|
||||
|
||||
tcache_nslots = (1U << sv);
|
||||
@@ -531,13 +540,13 @@ stats_print(void (*write4)(void *, const char *, const char *, const char *,
|
||||
tcache_nslots && ssv >= 0 ? umax2s(tcache_gc_sweep,
|
||||
10, s) : "N/A", "\n", "");
|
||||
}
|
||||
if ((err = mallctl("opt.lg_prof_bt_max", &sv, &ssz, NULL, 0))
|
||||
== 0) {
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.lg_prof_bt_max", &sv, &ssz,
|
||||
NULL, 0)) == 0) {
|
||||
write4(w4opaque, "Maximum profile backtrace depth: ",
|
||||
umax2s((1U << sv), 10, s), "\n", "");
|
||||
}
|
||||
if ((err = mallctl("opt.lg_prof_interval", &sv, &ssz, NULL, 0))
|
||||
== 0) {
|
||||
if ((err = JEMALLOC_P(mallctl)("opt.lg_prof_interval", &sv,
|
||||
&ssz, NULL, 0)) == 0) {
|
||||
write4(w4opaque, "Average profile dump interval: ",
|
||||
umax2s((1U << sv), 10, s), "", "");
|
||||
write4(w4opaque, " (2^", umax2s(sv, 10, s), ")\n", "");
|
||||
@@ -571,8 +580,8 @@ stats_print(void (*write4)(void *, const char *, const char *, const char *,
|
||||
CTL_GET("stats.chunks.total", &chunks_total, uint64_t);
|
||||
CTL_GET("stats.chunks.high", &chunks_high, size_t);
|
||||
CTL_GET("stats.chunks.current", &chunks_current, size_t);
|
||||
if ((err = mallctl("swap.avail", &swap_avail, &ssz, NULL, 0))
|
||||
== 0) {
|
||||
if ((err = JEMALLOC_P(mallctl)("swap.avail", &swap_avail, &ssz,
|
||||
NULL, 0)) == 0) {
|
||||
size_t lg_chunk;
|
||||
|
||||
malloc_cprintf(write4, w4opaque, "chunks: nchunks "
|
||||
|
||||
Reference in New Issue
Block a user