2011-05-18 Ivan Maidanski <ivmai@mail.ru>
+ * include/private/gcconfig.h (MPROTECT_VDB): Undefine if PROC_VDB.
+ * tests/test.c (NUMBER_ROUND_UP): New macro.
+ * tests/test.c (check_heap_stats): Round up total expected heap
+ size to the nearest 4 MiB bound.
+ * tests/test.c (check_heap_stats): Print the current and expected
+ heap sizes in case of failure.
+
+2011-05-18 Ivan Maidanski <ivmai@mail.ru>
+
* checksums.c (GC_check_blocks, GC_check_dirty): Do log printing
only if GC_print_stats; print errors using GC_err_printf.
* checksums.c (GC_check_blocks): Join adjacent printf() calls into
/* #undef GWW_VDB - handled in os_dep.c */
#endif
+#ifdef PROC_VDB
+ /* Multi-VDB mode is not implemented. */
+# undef MPROTECT_VDB
+#endif
+
#if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB) \
&& !defined(GWW_VDB) && !defined(GC_DISABLE_INCREMENTAL)
# define DEFAULT_VDB
GC_log_printf("Finished %p\n", &start_time);
}
+#define NUMBER_ROUND_UP(v, bound) ((((v) + (bound) - 1) / (bound)) * (bound))
+
void check_heap_stats(void)
{
size_t max_heap_sz;
# endif
# endif
# endif
+ max_heap_sz *= n_tests;
+# ifdef USE_MMAP
+ max_heap_sz = NUMBER_ROUND_UP(max_heap_sz, 4 * 1024 * 1024);
+# endif
/* Garbage collect repeatedly so that all inaccessible objects */
/* can be finalized. */
while (GC_collect_a_little()) { }
GC_printf("Incorrect execution - missed some allocations\n");
FAIL;
}
- if (GC_get_heap_size() + GC_get_unmapped_bytes() > max_heap_sz*n_tests) {
- GC_printf("Unexpected heap growth - collector may be broken\n");
+ if (GC_get_heap_size() + GC_get_unmapped_bytes() > max_heap_sz) {
+ GC_printf("Unexpected heap growth - collector may be broken"
+ " (heapsize: %lu, expected: %u)\n",
+ (unsigned long)(GC_get_heap_size() + GC_get_unmapped_bytes()),
+ max_heap_sz);
FAIL;
}
# ifdef THREADS