optimize_for_size

Controls optimization to reduce the size of object code.

Syntax

#pragma optimize_for_size on | off | reset

Targets
All platforms.
Remarks

This setting lets you choose what the compiler does when it must decide between creating small code or fast code. If you enable this pragma, the compiler creates smaller object code at the expense of speed. It also ignores the inline directive and generates function calls to call any function declared inline. If you disable this pragma, the compiler creates faster object code at the expense of size.

The pragma corresponds to the Optimize for Size setting in the Global Optimizations panel. To check this setting, use __option (optimize_for_size), described in Checking Settings.