Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'jam-files/engine/boehm_gc/tests/middle.c')
-rw-r--r--jam-files/engine/boehm_gc/tests/middle.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/jam-files/engine/boehm_gc/tests/middle.c b/jam-files/engine/boehm_gc/tests/middle.c
new file mode 100644
index 000000000..ebb348c49
--- /dev/null
+++ b/jam-files/engine/boehm_gc/tests/middle.c
@@ -0,0 +1,26 @@
+/*
+ * Test at the boundary between small and large objects.
+ * Inspired by a test case from Zoltan Varga.
+ */
+#include <gc.h>
+#include <stdio.h>
+
+int main ()
+{
+ int i;
+
+ GC_all_interior_pointers = 0;
+ GC_INIT();
+
+ for (i = 0; i < 20000; ++i) {
+ GC_malloc_atomic (4096);
+ GC_malloc (4096);
+ }
+ for (i = 0; i < 20000; ++i) {
+ GC_malloc_atomic (2048);
+ GC_malloc (2048);
+ }
+ printf("Final heap size is %ld\n", GC_get_heap_size());
+ return 0;
+}
+