gnuradio / volk

The Vector Optimized Library of Kernels

Home Page:http://libvolk.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

volk_malloc should not printf

marcusmueller opened this issue · comments

volk_malloc is a service routine; not being able to allocate memory is unfortunate, but just like normal libc malloc, the consumer needs to check whether an allocation worked, either way. The "printf debugging" shouldn't be "normally on", as a library shouldn't do freaky things to a user's stderr on its own – especially not using fprintf in an environment where output buffering might already be handled by the C++ runtime to begin with.

I assume you refer to:

fprintf(stderr, "VOLK: Error allocating memory: either size or alignment is 0");

and other occurrences of fprintf in that file and function.
As far as I remember, it's always been there.

I could imagine that simply removing the fprintf lines would be reasonable.