Software Optimization Guide for AMD64 Processors

25112 Rev. 3.06 September 2005

2.13Use of const Type Qualifier

Optimization

For objects whose values will not be changed, use the const type qualifier.

Application

This optimization applies to:

32-bit software

64-bit software

Rationale

Using the const type qualifier makes code more robust and may enable the compiler to generate higher-performance code. For example, under the C standard, a compiler is not required to allocate storage for an object that is declared const, if its address is never used.

30

C and C++ Source-Level Optimizations

Chapter 2

Page 46
Image 46
AMD 250 manual Use of const Type Qualifier