NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Restrict Type Qualifier
The restrict
type qualifier can be used to greatly speed up certain loops. However, if not used properly, it can result in code that has undefined behavior. The following links describe the proper and improper use of the restrict
type qualifier.
- Performance Tuning with the "Restrict" Keyword (TI)
- How to use the restrict qualifier in C (Oracle)
- Restricted pointers in C (Numerical C Extensions Group, Aliasing Subcommittee) See especially section 3.
- Demystifying The Restrict Keyword If you like a dose of warped humor with your technical reading, then this link is for you.
Also refer to the C99 standard, section 6.7.3.1.
In some instances, the restrict keyword may not affect performance in a way that the programmer expects. The wiki page Restrict Inlining Problem describes one such situation.