bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dere


From: Samuel Thibault
Subject: Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__
Date: Tue, 17 Dec 2013 18:51:49 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

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

[Prev in Thread] Current Thread [Next in Thread]