This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: restrict


> I have never seen restrict keyword..any ideas?

It was introduced in C99, and in a few compilers before that.  Roughly
speaking it means the memory pointed to by the restrict pointer is not
aliased by anything else visible in that scope, so the compiler is free
to optimise the code assuming no other pointer write writes over memory.

Take for example:
  int foo (int *restrict a, int *restrict b)
  { a[1] = b[1]; return b[0] + a[1]; }

The compiler can assume the assignment to a[1] will not have modified b[0].

Hope this helps,
//lat
-- 
The stone fell on the pitcher? Woe to the pitcher. The
pitcher fell on the stone? Woe to the pitcher.
	--Rabbinic Sayning


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]