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

Julien Fischer jfischer at opturion.com
Wed Aug 13 14:16:15 AEST 2014


On Wed, 13 Aug 2014, Paul Bone 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.  (And for reasons that mystify
>> me at the moment, the whole thing breaks when I attempt to build the runtime
>> in hlc.par.gc.ll_debug, but not in hlc.par.gc -- that's what the above
>> patch works
>> around.)
>
> I don't remember the specifics off hand.  I'd have to check the archives and
> also review the code.  This is why I want to review this code and check it
> all.

One of the things that needs to be done when you do get around to
reviewing it is to check whether we can use C11's support for atomic
operations (i.e. the ones defined in stdatomic.h) instead of compiler
intrinsics or inline asm.

Cheers,
Julien.



More information about the reviews mailing list