About the reference count of python-side returned objects
- 主要語言
- C++
- 星號
- 537
- 分支
- 223
- 平均合併
- 11 小時 22 分鐘
- 30 天內合併 PR
- 2
描述
Hi there, if I use boost_python to call a python side function and get a boost::python::object return, it seems that the reference count of wrapped obj.ptr() is at least 1 as they are set to one when created. But I don't think the reference count will be reduced automatically when boost::python::object is destructed (please correct me if I am wrong). If so, how can this memory be freed, should we manually decrease the reference count so that python GC can work? This is especially important if a large object like numpy::ndarray if returned, I am not sure whether C-side or Py-side should take charge of freeing the memory. Thanks in advance!
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
No repository file, test, or entry point is named. Start by reading the Boost.Python object and obj.ptr() ownership behavior, then check how returned Python objects and large numpy::ndarray values are reference-counted. Done means documenting or correcting the ownership behavior so Python garbage collection and C++ destruction are unambiguous.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- cpp, numpy, python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100