how to remove calloc or malloc from code
Hi
I have a code in C where I am using external library functions provided for example by GRAMPC optimization solver. The code contains calloc and malloc for memory allocation.
I want to implement my code on hardware like FPGA as well as ARM processors. The code is working properly on ARM board. but for FPGA implementation I cant have dynamic allocation of memory -so cant use malloc or new either.
Please suggest a way to achieve that.
Code:
typedef struct
{
typeGRAMPCparam *param;
typeGRAMPCopt *opt;
typeGRAMPCsol *sol;
typeGRAMPCrws *rws;
typeUSERPARAM *userparam;
} typeGRAMPC;
(*grampc)->opt = (typeGRAMPCopt *)calloc(1, sizeof(*(*grampc)->opt));
if ((*grampc)->opt == NULL) {
grampc_error(OPT_ALLOC_FAILED);
}