Re[4]: [Gc] gctest: use of AO_fetch_and_add1

Ivan Maidanski ivmai at mail.ru
Wed May 27 23:11:04 PDT 2009


Hi!

"Boehm, Hans" <hans.boehm at hp.com> wrote:
> Thanks.  That helps.
> 
> Committed, except for
> 
> @@ -1308,12 +1309,13 @@
>      	           (GC_bytes_allocd + GC_bytes_allocd_before_gc));
>      (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
> +    if (GC_bytes_allocd + GC_bytes_allocd_before_gc < n_tests *
>  #   ifdef VERY_SMALL_CONFIG
> -        < 2700000*n_tests) {
> +        2700000
>  #   else
> -        < 33500000*n_tests) {
> +        33500000
>  #   endif
> +        ) {
>          (void)GC_printf("Incorrect execution - missed some allocations\n");
>          FAIL;
>      }
> 
> ... That problem is worth fixing, though I think it can only result in spurious test failures.  But I'm not sure the patch above improves matters, since it leaves the data races in the code.
> 
> Hans 

My code is fully equivalent to the existing one. I just rewrote it to make '(' and ')' balanced (same for '{', '}') - purely for LINT-like tools and editor syntax highlighters.

As for the mentioned problem - a "FIXME" should be added here.

ye.



More information about the Gc mailing list