Main Content

Reuse buffers of different sizes and dimensions

Reuse buffers to store data of different sizes and dimensions

Model Configuration Pane: Code Generation / Optimization

Description

The Reuse buffers of different sizes and dimensions parameter specifies to reduce memory consumption by reusing buffers to store data of different sizes and dimensions.

Dependencies

This parameter is enabled by Signal storage reuse.

Settings

on (default) | off
On

The code generator tries to reuse the same buffers to store data of different sizes and dimensions. This optimization conserves RAM and ROM consumption.

Off

The code generator reuses buffers only if they have the same size and shape as the data.

Tips

  • If your model contains a reusable custom storage class to specify reuse on signals that have different sizes and shapes, you must select the Reuse buffers of different sizes and dimensions parameter or remove the specification. Otherwise, during simulation, the model produces an error.

  • The code generator does not replace a buffer with a lower priority buffer that has a smaller size.

  • The code generator does not reuse buffers that have different sizes and symbolic dimensions.

Recommended Settings

ApplicationSetting
Debuggingoff
Traceabilityoff
Efficiencyon
Safety precautionNo impact

Programmatic Use

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

Version History

Introduced in R2017b