I'm using PyBind11 to run a Python interpreter, and I need to call a Python function in c++ with some pointer arguments.
According to the docs of pybind11, it looks like that a argument being passed to Python side should be freed normally by the Python interpreter, instead of the c++ main program. But this time the argument is a pointer to a static object, it should NOT be freed by anyone. How to code such a binding/calling?
I know that pybind11::return_value_policy::reference
can be used to prevent a returning result from being freed, but it is for a returning object, not for arguments.
Any hint will be appreciated!