I am trying to compile a C++ code, in this code I am defining two large arrays of 405 elements each.
double a [405] = {...};
double b [405] = {...};
Then I convert these into vectors using this function:
std::vector<double> ArrayToVector(double* arr, size_t arr_len) {
return std::vector<double>(arr, arr + arr_len);
}
Then I do the conversion:
std::vector<double> coefs_vec= ArrayToVector(a,405);
std::vector<double> ft_vec= ArrayToVector(b,405);
And here were the overflow occurs and I get those errors:
error: sram_out/sram.elf section `.text' will not fit in region `int_main'
error: region `int_main' overflowed by 35816 bytes
collect2: error: ld returned 1 exit status
I tried using dynamic memory for some previous used variables but the problem is mainly caused by this big arrays. Is there a way I can solve this problem? Maybe a better way to define those arrays with less memory usage.