Unify buffer reuse candidates
Analyze buffer reuse candidates to implement efficient reuses
Since R2025a
Model Configuration Pane: Code Generation / Optimization
Description
The Unify buffer reuse candidates parameter instructs the code generator to first analyze potential buffer reuse candidates and identify the efficient reuses, and then implement them in the generated code. Buffer reuse candidates are buffers that can potentially be reused.
Dependencies
To enable this parameter:
Select the Specify custom optimizations parameter.
Select the Signal storage reuse parameter.
Clear the Reuse buffers of different sizes and dimensions parameter.
Settings
off
(default) |
on
- On
The code generator first analyzes potential buffer reuse candidates, identifies the efficient reuses, and then implements them in the generated code. Analyzing the potential buffer reuse candidates and identifying the efficient reuses upfront reduces the possibility of missing reuse opportunities, which can reduce RAM consumption. However, for some modeling patterns, this optimization might not eliminate some data copies.
- Off
The code generator does not analyze the buffer reuse candidates and does not identify the efficient reuses upfront. Instead, the code generator implements the reuses in phases. Implementing reuse in phases can result in missed reuse opportunities.
Recommended Settings
Application | Setting |
---|---|
Debugging | Off |
Traceability | Off |
Efficiency | On |
Safety precaution | No impact |
Programmatic Use
Parameter:
UnifyBufferReuse
|
Type: character vector |
Value:
'on' | 'off'
|
Default:
'off'
|
Version History
Introduced in R2025a