summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2014-05-28 18:23:01 (GMT)
committerJason Evans <je@fb.com>2014-05-28 18:23:01 (GMT)
commit99118622ff5204feaabd2ee4109a7847ab388282 (patch)
treeae95d3414fdde755c28ee7bdeb30f4cd2bf41ee7
parent26f44df742893306a53a90328e15a62ed11b9e57 (diff)
downloadjemalloc-99118622ff5204feaabd2ee4109a7847ab388282.zip
jemalloc-99118622ff5204feaabd2ee4109a7847ab388282.tar.gz
jemalloc-99118622ff5204feaabd2ee4109a7847ab388282.tar.bz2
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.
-rw-r--r--test/src/test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/src/test.c b/test/src/test.c
index 17728ca..0f8bd49 100644
--- a/test/src/test.c
+++ b/test/src/test.c
@@ -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);
}