You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, modules created by pybind11 have no m_free function. For most applications, it works fine, and in some cases having an m_free function would actually cause a crash (I've read the discussion in some PR that introduced an m_free function). But other applications (for example the one I am developing, Carnets) need to clean up memory and re-initialize variables when leaving Python.
Cython has solved the issue by providing an option (generate_cleanup_code). By default it is set to 0 (no cleanup code), but if it is set to a value larger than 3, Cython generates extensive cleanup code for everything. Would it be possible to have a similar option for pybind11?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, modules created by pybind11 have no
m_free
function. For most applications, it works fine, and in some cases having anm_free
function would actually cause a crash (I've read the discussion in some PR that introduced anm_free
function). But other applications (for example the one I am developing, Carnets) need to clean up memory and re-initialize variables when leaving Python.Cython has solved the issue by providing an option (
generate_cleanup_code
). By default it is set to 0 (no cleanup code), but if it is set to a value larger than 3, Cython generates extensive cleanup code for everything. Would it be possible to have a similar option for pybind11?Beta Was this translation helpful? Give feedback.
All reactions