From c722dc23c07dc73f0a3f73d5f54d9b39a25bea2d Mon Sep 17 00:00:00 2001 From: ivmai Date: Sat, 2 Apr 2011 08:15:06 +0000 Subject: [PATCH] 2011-04-02 Ivan Maidanski * tests/test.c (reverse_test_inner): Test interior pointer recognition only if ALL_INTERIOR_POINTERS. * tests/test.c (run_one_test): Replace GC_all_interior_pointers with GC_get_all_interior_pointers(); simplify the expression. * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and GC_bytes_allocd_before_gc with GC_get_total_bytes(). * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no(). --- ChangeLog | 23 +++++++++++++++++------ tests/test.c | 14 +++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02b53a8f..39574847 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-04-02 Ivan Maidanski + + * tests/test.c (reverse_test_inner): Test interior pointer + recognition only if ALL_INTERIOR_POINTERS. + * tests/test.c (run_one_test): Replace GC_all_interior_pointers + with GC_get_all_interior_pointers(); simplify the expression. + * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and + GC_bytes_allocd_before_gc with GC_get_total_bytes(). + * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no(). + 2011-03-27 Ivan Maidanski * dbg_mlc.c (GC_debug_strdup, GC_debug_free): Output a portability @@ -49,12 +59,13 @@ 2011-03-22 Ivan Maidanski - * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 when - doing code static analysis (to inform the tool that the function is - a no-return one). - * os_dep.c (GC_linux_stack_base): Remove a duplicate validation of the - length of "stat" file; use signed int type for "i", "buf_offset" and - "len" local variables (since read() may return -1). + * misc.c (GC_abort): Use _exit() (instead of DebugBreak) on Win32 + when doing code static analysis (to inform the tool that the + function is a no-return one). + * os_dep.c (GC_linux_stack_base): Remove a duplicate validation + of the length of "stat" file; use signed int type for "i", + "buf_offset" and "len" local variables (since read() may + return -1). 2011-03-20 Ivan Maidanski diff --git a/tests/test.c b/tests/test.c index d8cf4f68..c271073f 100644 --- a/tests/test.c +++ b/tests/test.c @@ -588,9 +588,11 @@ void *GC_CALLBACK reverse_test_inner(void *data) for (i = 0; i < 10; i++) { (void)ints(1, BIG); } - /* Superficially test interior pointer recognition on stack */ +# ifdef ALL_INTERIOR_POINTERS + /* Superficially test interior pointer recognition on stack */ c = (sexpr)((char *)c + sizeof(char *)); d = (sexpr)((char *)d + sizeof(char *)); +# endif GC_FREE((void *)e); @@ -1143,8 +1145,7 @@ void run_one_test(void) # if defined(RS6000) || defined(POWERPC) if (!TEST_FAIL_COUNT(1)) # else - if ((GC_all_interior_pointers && !TEST_FAIL_COUNT(1)) - || (!GC_all_interior_pointers && !TEST_FAIL_COUNT(2))) + if (!TEST_FAIL_COUNT(GC_get_all_interior_pointers() ? 1 : 2)) # endif { GC_printf("GC_is_valid_displacement produced wrong failure indication\n"); @@ -1326,11 +1327,10 @@ void check_heap_stats(void) } } (void)GC_printf("Total number of bytes allocated is %lu\n", - (unsigned long) - (GC_bytes_allocd + GC_bytes_allocd_before_gc)); + (unsigned long)GC_get_total_bytes()); (void)GC_printf("Final heap size is %lu bytes\n", (unsigned long)GC_get_heap_size()); - if (GC_bytes_allocd + GC_bytes_allocd_before_gc < n_tests * + if (GC_get_total_bytes() < n_tests * # ifdef VERY_SMALL_CONFIG 2700000 # else @@ -1703,7 +1703,7 @@ int main(void) check_heap_stats(); (void)fflush(stdout); pthread_attr_destroy(&attr); - GC_printf("Completed %u collections\n", (unsigned)GC_gc_no); + GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no()); # ifdef PTW32_STATIC_LIB pthread_win32_thread_detach_np (); pthread_win32_process_detach_np (); -- 2.40.0