In the C programming language, as of the C99 standard, restrict
is a keyword that can be used in pointer declarations. The restrict
keyword is a declaration of intent given by the programmer to the compiler. It says that for the lifetime of the pointer, only it or a value directly derived from it (such as pointer + 1
) will be used to access the object to which it points. This limits the effects of pointer aliasing, aiding caching optimizations. If the declaration of intent is not followed and the object is accessed by an independent pointer, this will result in undefined behavior. The use of the restrict
keyword in C, in principle, allows non-obtuse C to achieve the same performance as the same program written in Fortran.
Read more about Restrict: Optimization, References
Famous quotes containing the word restrict:
“The expectation that every neurotic phenomenon can be cured may, I suspect, be derived from the laymans belief that the neuroses are something quite unnecessary which have no right whatever to exist. Whereas in fact they are severe, constitutionally fixed illnesses, which rarely restrict themselves to only a few attacks but persist as a rule over long periods throughout life.”
—Sigmund Freud (18561939)
“A house means a family house, a place specially meant for putting children and men in so as to restrict their waywardness and distract them from the longing for adventure and escape theyve had since time began.”
—Marguerite Duras (b. 1914)