Marin Ramesa, le Tue 17 Dec 2013 15:58:27 +0100, a écrit :
> Qualifier __restrict__ means that only the pointer under __restrict__ will be 
> used
> to access dereferenced values.

Yes.

> So if a code is under locks and no function is called
> in the critical section with pointer as an argument, it's safe to use 
> __restrict__.

Not really: the critical section might be still using other pointers
which points at the same underlying data.

> This allows the compiler to make optimizations.

I don't think we benefit very much here, do we?  restrict is a very
difficult thing to maintain, few programmers really understand what it
means, I'd rather avoid introducing too many of them.

Samuel

Reply via email to