Main Content

Memcpy threshold (bytes)

Specify minimum array size for which memcpy and memset function calls replace for loops for vector assignments

Model Configuration Pane: Code Generation / Optimization

Description

The Memcpy threshold (bytes) specifies the minimum array size in bytes for which memcpy and memset function calls should replace for loops for vector assignments in the generated code.

Dependencies

For the memcpy optimization, this parameter is enabled when you select Use memcpy for vector assignment.

Settings

64 (default) | ''

The code generator by default sets the parameter value 64 which you can change based on your optimization requirements.However, the maximum value for the Memcpy threshold (bytes) is 2147483647 bytes. If you set the parameter value at more than the maximum value, it automatically changes back to 2147483647 bytes.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyAccept default or determine target-specific optimal value
Safety precautionNo impact

Programmatic Use

Parameter: MemcpyThreshold
Type: integer
Value: valid quantity of bytes
Default: 64

Version History

Introduced in R2008b