Memcpy threshold (bytes) - Minimum size for memcpy or memset

        optimization  - MATLAB ([original](https://in.mathworks.com/help/coder/ref/memcpythresholdbytes.html)) ([raw](?raw))

Main Content

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.

Settings

64 | positive integer

Minimum size, in bytes, for the memcpyormemset 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