Here's a quote from the wrapper in bindings_swig/bingins.i:
void normalize_numpy(double* in_1, unsigned size_in_1,
double** out_1, int* size_out_1)
{
const std::vector<double> vector(in_1, in_1 + size_in_1);
auto result = mymath::normalize(vector);
*out_1 = static_cast<double*>(malloc(result.size() * sizeof(double)));
std::copy(result.begin(), result.end(), *out_1);
*size_out_1 = result.size();
}
I can see malloc. The question is when the vector is going to be deallocated on the Python side? Or would numpy do it implicitly (perhaps using Python's GC)?
Here's a quote from the wrapper in
bindings_swig/bingins.i:I can see
malloc. The question is when the vector is going to be deallocated on the Python side? Or wouldnumpydo it implicitly (perhaps using Python's GC)?