Can I optimize buffer usage in generated code for input and output arguments of a subsystem with Embedded Coder R2024a?
Show older comments
I have a large Simulink model that contains numerous subsystems and model references. The way my model works is that it modifies a large struct type (defined as a Simulink Bus) in place as it passes through components of my model. I am using this model to produce production C++ code using Embedded Coder. Given the scale of my model, and the large memory footprint of the struct type, I do not want reusable functions in my code which copies the struct to a new buffer for output. I want the function to optimize its buffer usage by modifying one struct variable in place.
This would effectively change the function signature for my reusable function from something like:
void exampleFunction(structType *structIn, structType *structOut) { ... }
to something like:
void exampleFunction(structType *structInAndOut) { ... }
where one argument is modified in place and treated as output.
I have done this with Model References in my model.
Is this possible for reusable functions of a subsystem?
Accepted Answer
More Answers (0)
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!