uint8_t *cell_data = (uint8_t *) malloc((NUM_RX_BYT*TOTAL_IC)*sizeof(uint8_t));
// some code between ...
free(cell_data);
to this:
uint8_t cell_data[NUM_RX_BYT*TOTAL_IC];
When I change malloc/free everywhere in my version of LTC681x.cpp my program was 334 bytes smaller. (ATmega2560 and ATmega2561). For this use case we shouldn't really be using malloc/free if it is not a must.
For example we change this:
to this:
When I change malloc/free everywhere in my version of
LTC681x.cpp
my program was 334 bytes smaller. (ATmega2560 and ATmega2561). For this use case we shouldn't really be using malloc/free if it is not a must.