jemalloc/jemalloc-4.2.1.upstream_bug393_2.patch

29 lines
956 B
Diff
Raw Normal View History

From eaecaad8ea9fd9cd8b57e49834b5e3332f911c40 Mon Sep 17 00:00:00 2001
From: Jason Evans <jasone@canonware.com>
Date: Fri, 28 Oct 2016 11:00:36 -0700
Subject: [PATCH] Periodically purge in memory-intensive integration tests.
This resolves #393.
---
test/integration/mallocx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c
index 69ce781..79ab494 100644
--- a/test/integration/mallocx.c
+++ b/test/integration/mallocx.c
@@ -139,6 +139,13 @@ TEST_BEGIN(test_basic)
rsz = sallocx(p, 0);
assert_zu_eq(nsz, rsz, "nallocx()/sallocx() rsize mismatch");
dallocx(p, 0);
+ /*
+ * On systems which can't merge extents, this test generates a
+ * lot of dirty memory very quickly. Purge between cycles to
+ * avoid potential OOM on e.g. 32-bit Windows.
+ */
+ assert_d_eq(mallctl("arena.0.purge", NULL, NULL, NULL, 0), 0,
+ "Unexpected mallctl error");
}
#undef MAXSZ
}