I am trying to convert an array of floats(fft_test->output) into a list that I can return on a C module.
I had a look through obj.h and mp_obj_new_bytearray seemed like the best choice.
void *fft_output = fft_test->output;
mp_obj_t fft_list = mp_obj_new_bytearray(sizeof(fft_output), fft_output);
return fft_list;
This will return "segmentation fault (core dump)"
returning a list from C module
Re: returning a list from C module
sizeof(fft_output) will be the sizeof the pointer which will be 4 or 8 bytes depending in the CPU you're targeting.
The fact that it segfaults probably points to fft_output not being valid.
The fact that it segfaults probably points to fft_output not being valid.