Use nallocx() rather than mallctl() to trigger initialization.
Use nallocx() rather than mallctl() to trigger initialization, because nallocx() has no side effects other than initialization, whereas mallctl() does a bunch of internal memory allocation.
This commit is contained in:
parent
26f44df742
commit
99118622ff
@ -73,7 +73,7 @@ p_test(test_t *t, ...)
|
|||||||
* is a final safety that works even if jemalloc_constructor() doesn't
|
* is a final safety that works even if jemalloc_constructor() doesn't
|
||||||
* run, as for MSVC builds.
|
* run, as for MSVC builds.
|
||||||
*/
|
*/
|
||||||
if (mallctl("version", NULL, NULL, NULL, 0) != 0) {
|
if (nallocx(1, 0) == 0) {
|
||||||
malloc_printf("Initialization error");
|
malloc_printf("Initialization error");
|
||||||
return (test_status_fail);
|
return (test_status_fail);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user