From: ivmai Date: Wed, 18 May 2011 09:40:00 +0000 (+0000) Subject: 2011-05-18 Ivan Maidanski X-Git-Tag: gc7_2alpha6~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca58b8ecc27bf3c617751405b9bbc0ffbd9f0a14;p=gc 2011-05-18 Ivan Maidanski * 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. --- diff --git a/ChangeLog b/ChangeLog index 2bf04567..88fefdc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-05-18 Ivan Maidanski + + * 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 * checksums.c (GC_check_blocks, GC_check_dirty): Do log printing diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 9e277e5b..9052d22e 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -2399,6 +2399,11 @@ /* #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 diff --git a/tests/test.c b/tests/test.c index 63a10527..b844b63c 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1236,6 +1236,8 @@ void run_one_test(void) 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; @@ -1271,6 +1273,10 @@ void check_heap_stats(void) max_heap_sz += max_heap_sz * SAVE_CALL_COUNT/4; # 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. */ @@ -1337,8 +1343,11 @@ void check_heap_stats(void) 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