Originally went down the route of attempting to use py::capsule to avoid having to perform a memory copy (as described in https://github.com/pybind/pybind11/issues/1042#issuecomment-325941022), but think because we wrap them in std::array the vectors are cleaned up before the capsule triggers.
Probably should look at py::capsule in the future as it could reduce the memory copying taking place in our wrapped code as well as reduce the amount of time we require the GIL (relating to #1370 )
py::capsule
to avoid having to perform a memory copy (as described in https://github.com/pybind/pybind11/issues/1042#issuecomment-325941022), but think because we wrap them instd::array
the vectors are cleaned up before the capsule triggers.py::capsule
in the future as it could reduce the memory copying taking place in our wrapped code as well as reduce the amount of time we require the GIL (relating to #1370 )