[m-rev.] for review: Enable thread-local allocation and parallel marking on more platforms.

Peter Wang novalazy at gmail.com
Tue Aug 12 17:56:50 AEST 2014


On Tue, 12 Aug 2014 17:20:45 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> diff --git a/runtime/mercury_memory_zones.c b/runtime/mercury_memory_zones.c
> index 91f9f89..df418b6 100644
> --- a/runtime/mercury_memory_zones.c
> +++ b/runtime/mercury_memory_zones.c
> @@ -514,7 +514,7 @@ MR_next_offset(void)
> 
>      old_counter = offset_counter;
>      new_counter = (old_counter + 1) % (CACHE_SLICES - 1);
> -#if defined(MR_THREAD_SAFE)
> +#if defined(MR_LL_PARALLEL_CONJ)
>      /*
>      ** The critical section here is really small, a CAS will work well.
> 
> The macros protecting MR_compare_and_swap_int and friends do
> not appear to be consistent.  The declarations are protected by
> MR_THREAD_SAFE
> but the definitions by MR_LL_PARALLEL_CONJ.

Atomic op primitives are applicable to high-level .par grades as well,
even if we wouldn't use them as much, so MR_THREAD_SAFE should be
correct.

Peter



More information about the reviews mailing list