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:
Jason Evans 2014-05-28 11:23:01 -07:00
parent 26f44df742
commit 99118622ff

View File

@ -73,7 +73,7 @@ p_test(test_t *t, ...)
* is a final safety that works even if jemalloc_constructor() doesn't
* run, as for MSVC builds.
*/
if (mallctl("version", NULL, NULL, NULL, 0) != 0) {
if (nallocx(1, 0) == 0) {
malloc_printf("Initialization error");
return (test_status_fail);
}