Periodically purge in memory-intensive integration tests.
This resolves #393.
diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c
index 175be8e..3b8097e 100644
--- a/test/integration/mallocx.c
+++ b/test/integration/mallocx.c
@@ -139,6 +139,13 @@
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
}