Set Dynamic Memory Allocation Threshold - MATLAB & Simulink (original) (raw)

By default, the code generator uses dynamic memory allocation for variable-size arrays. Dynamic memory allocation optimizes storage requirements for variable-size arrays, but causes slower execution of generated code. To balance memory and performance requirements, you can disable dynamic memory allocation for arrays less than a certain size.

Specify this threshold when you want to:

To specify a dynamic memory allocation threshold, dynamic memory allocation must be enabled. To make sure that dynamic memory allocation is enabled, use one of these approaches:

If dynamic memory allocation is enabled, set the dynamic memory allocation threshold by using one of these approaches:

The dynamic memory allocation threshold is measured in bytes. Based on information from the target hardware settings, the code generation estimates the size of the array that the configured threshold can accommodate. This estimate excludes possible C compiler optimizations, such as putting variables in registers.

See Also

Topics