Matlab coder difference between 2016a to 2018b

3 views (last 30 days)
Hi,
we have a relative big .m file which we generate C code from it,
recently we try to move to 2018b but the generated C code got alot more allocated memory then before,
without touching the .m code (just changing to 2018b)
and running the same build script,
in 2018b we get alot more redundant memory allocation like this:
myHugeStruct data; // few giga of memory
.
.
.
someInnerStruct f_data[1500]; //1 inner struct of 'myHugeStruct'
for (nRes=0;nRes<1500;nRes++){
f_data[nRes] = data->someInnerStruct[nRes];
}
somefunction(f_data);
in 2016a it was simply this:
myHugeStruct data; // few giga of memory
.
.
.
somefunction(data->someInnerStruct);
what can make such changes? too much memory allocations like that make us crush now,
maybe a new compilation flag that i need to turn off?
thanks
  1 Comment
Sumit Ghosh
Sumit Ghosh on 20 Feb 2019
Hi Josh,
This looks like an unintended regression.
Just out of curiosity, have you used the pattern
x = foo(x)
in your matlab code. If so, you could try updating the code to use
x.a = foo(x.a)
and see the generated code.
In any case, this looks like an interesting problem to investigate, and you can contact tech support giving reproduction steps for the issue.
https://www.mathworks.com/support/contact_us.html
Thanks.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Coder 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!