You copied the Doc URL to your clipboard.

#pragma Ospace

This pragma optimizes all subsequent functions for code size, performing optimizations to reduce image size at the expense of a possible increase in execution time.

Usage

To optimize all subsequent functions for code size, use #pragma Ospace. For example, when compiling with armcc -Otime:

void function1(void){
    ...                // Optimized for execution time (from armcc -Otime)
}

#pragma Ospace
void function2(void){
    ...                // Optimized for code size
}

void function3(void){
    ...                // Optimized for code size
}

To optimize an individual function for code size, use #pragma Ospace together with #pragma push and #pragma pop. For example, when compiling with armcc -Otime:

void function1(void){
    ...                 // Optimized for execution time (from armcc -Otime)
}
#pragma push
#pragma Ospace
void function2(void){
    ...                 // Optimized for code size
}
#pragma pop

void function3(void){
    ...                 // Optimized for execution time (from armcc -Otime)
}

Restriction

The pragma must be placed outside a function.

Was this page helpful? Yes No