MATLAB Answers

Matlab coder difference between 2016a to 2018b

10 ビュー (過去 30 日間)
josh mosh
josh mosh 2019 年 2 月 20 日
コメント済み: Sumit Ghosh 2019 年 2 月 20 日
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];
in 2016a it was simply this:
myHugeStruct data; // few giga of memory
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?

  1 件のコメント

Sumit Ghosh
Sumit Ghosh 2019 年 2 月 20 日
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.


回答 (0 件)

Translated by