Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__

2013-12-17 Thread Marin Ramesa
On 18.12.2013 00:17:38, Richard Braun wrote: > On Tue, Dec 17, 2013 at 03:58:27PM +0100, Marin Ramesa wrote: > > Qualifier __restrict__ means that only the pointer under > > __restrict__ will be used to access dereferenced values. So if a > > code is under locks and no function is called in the cr

Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__

2013-12-17 Thread Richard Braun
On Tue, Dec 17, 2013 at 03:58:27PM +0100, Marin Ramesa wrote: > Qualifier __restrict__ means that only the pointer under __restrict__ will be > used > to access dereferenced values. So if a code is under locks and no function is > called > in the critical section with pointer as an argument, it's

Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__

2013-12-17 Thread Richard Braun
On Tue, Dec 17, 2013 at 06:51:49PM +0100, Samuel Thibault wrote: > 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. I agree. Note that GNU Mach is bui

Re: [PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__

2013-12-17 Thread Samuel Thibault
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, i

[PATCH 3/4] device/chario.c: qualify pointers that access their dereferenced values under locks with __restrict__

2013-12-17 Thread Marin Ramesa
Qualifier __restrict__ means that only the pointer under __restrict__ will be used to access dereferenced values. 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__. This allows the compiler to make optimizatio