I'm working on a C++ project using a FRDM-KL25Z board to measure vibration. My code is working but I need it running on a loop. I'm having problems with memory, I don't have enough space to store the values twice. I used free() commands but even that I'm nothing get all my memory back. Someone knows how to clean all memory used by kiss-fft? It doesn't have a free function, or at list the one that it has doesn't work properly.
I have enough memory to run it just once and show the results. I was trying to do a loop with this function but even using free command I'm nothing getting my initial memory back.
{
void TestFftReal(const char* title, const kiss_fft_scalar in[L], kiss_fft_cpx out[L / 2 + 1])
kiss_fftr_cfg cfg;
cfg = kiss_fftr_alloc(L, 0/*is_inverse_fft*/, NULL, NULL);
if (cfg != NULL) {
size_t i;
kiss_fftr(cfg, in, out);
free(cfg);
/// Do stuff ///
} else {
printf("Not enough memory.\n");
exit(-1);
}
}