Main Content

Memcpy threshold (bytes)


Specify the minimum array size in bytes for which memcpy and memset function calls should replace for loops for vector assignments in the generated code.

Category: Optimization


Default: 64


The maximum value of the Memcpy threshold (bytes) parameter is 2147483647 bytes. If you set the parameter value at more than the maximum value, it automatically changes back to 2147483647 bytes.


  • This parameter requires a Simulink® Coder™ license.

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

Command-Line Information

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

Recommended Settings

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

Related Topics