Lets you override the internal decision heuristic for the particular algorithm used when implementing buffer manipulation functions such as memcpy and memset.

Syntax

Linux and macOS:

-mstringop-strategy=alg

Windows:

/Qstringop-strategy:alg

Arguments

alg

Specifies the algorithm to use. Possible values are:

const_size_loop

Tells the compiler to expand the string operations into an inline loop when the size is known at compile time and it is not greater than threshold value. Otherwise, the compiler uses its own heuristics to decide how to implement the string operation.

libcall

Tells the compiler to use a library call when implementing string operations.

rep

Tells the compiler to use its own heuristics to decide what form of rep movs | stos to use when inlining string operations.

Default

varies

If optimization option Os is specified, the default is rep. Otherwise, the default is const_size_loop.

Description

This option lets you override the internal decision heuristic for the particular algorithm used when implementing buffer manipulation functions such as memcpy and memset.

This option may have no effect on compiler-generated string functions, for example, a call to memcpy generated by the compiler to implement an array copy or structure copy.

IDE Equivalent

None

Alternate Options

None

See Also

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.