Main Content

Reuse output buffers of Model blocks

Reuse referenced model buffers if possible

Model Configuration Pane: Code Generation / Optimization

Description

Specify whether to reuse referenced model output buffers whenever possible.

Dependencies

Requires you to enable the Signal storage reuse parameter.

Settings

off (default) | on

Off

Referenced model outputs are stored in unique locations.

On

The code generator analyzes referenced model contents to determine if buffer reuse is possible. If buffer reuse is possible, it reuses signal memory or generates reusable temporary buffers to hold referenced model outputs, which can significantly reduce RAM consumption. This optimization does not work when function prototype control is applied to the referenced models.

Note

This optimization can produce some extra data copies in the generated code.

Recommended Settings

ApplicationSetting
DebuggingOff
TraceabilityOff
EfficiencyOn
Safety precautionNo impact

Programmatic Use

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

Version History

Introduced in R2022b