Main Content

Use dynamic memory allocation for model initialization

Description

Control how the generated code allocates memory for model data.

Category: Code Generation > Interface

Settings

Default: off

On

Generates a function to dynamically allocate memory (using malloc) for model data structures.

Off

Does not generate a dynamic memory allocation function. The generated code statically allocates memory for model data structures.

Dependencies

  • This parameter only appears for ERT-based targets with Code interface packaging set to Reusable function.

  • This parameter requires an Embedded Coder® license when generating code.

Command-Line Information

Parameter: GenerateAllocFcn
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precaution

No recommendation

See Also

Related Topics