mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Add prof_leak_error option
The option makes the process to exit with error code 1 if a memory leak is detected. This is useful for implementing automated tools that rely on leak detection.
This commit is contained in:
@@ -1578,6 +1578,26 @@ malloc_conf_init_helper(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
|
||||
CONF_HANDLE_BOOL(opt_prof_gdump, "prof_gdump")
|
||||
CONF_HANDLE_BOOL(opt_prof_final, "prof_final")
|
||||
CONF_HANDLE_BOOL(opt_prof_leak, "prof_leak")
|
||||
if (CONF_MATCH("prof_leak_error")) {
|
||||
if (CONF_MATCH_VALUE("true")) {
|
||||
if (!opt_prof_final) {
|
||||
CONF_ERROR(
|
||||
"prof_leak_error is"
|
||||
" not allowed"
|
||||
" without"
|
||||
" prof_leak_final",
|
||||
k, klen, v, vlen);
|
||||
} else {
|
||||
opt_prof_leak = true;
|
||||
opt_prof_leak_error =
|
||||
true;
|
||||
}
|
||||
} else if (!CONF_MATCH_VALUE("false")) {
|
||||
CONF_ERROR("Invalid conf value",
|
||||
k, klen, v, vlen);
|
||||
}
|
||||
CONF_CONTINUE;
|
||||
}
|
||||
CONF_HANDLE_BOOL(opt_prof_log, "prof_log")
|
||||
CONF_HANDLE_SSIZE_T(opt_prof_recent_alloc_max,
|
||||
"prof_recent_alloc_max", -1, SSIZE_MAX)
|
||||
|
||||
Reference in New Issue
Block a user