Main Content

Memcpy threshold (bytes)

Minimum size for memcpy or memset optimization

Description

App Configuration Pane: Advanced

Configuration Objects: coder.MexCodeConfig | coder.CodeConfig | coder.EmbeddedCodeConfig

The Memcpy threshold (bytes) parameter specifies the minimum size, in bytes, for memcpy or memset optimization.

To optimize generated code that copies consecutive array elements, the code generator tries to replace the code with a memcpy call. To optimize generated code that assigns a literal constant to consecutive array elements, the code generator tries to replace the code with a memset call.

The number of bytes is the number of array elements to copy or assign multiplied by the number of bytes required for the C/C++ data type.

If the number of elements to copy or assign is variable (not known at compile time), the code generator ignores the Memcpy threshold (bytes) parameter.

Dependencies

To enable this parameter, select the Use memcpy for vector assignment check box.

Settings

64 | positive integer

Minimum size, in bytes, for the memcpyor memset optimization, specified as a positive integer. The default value for this setting is 64.

Programmatic Use

Property: MemcpyThreshold
Values: 64 | positive integer
Default: 64

Version History

Introduced in R2011a