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
To support multi data type, PR #210 introduced IndexNodeDataMockWrapper::xxx, in which DataSet reference is converted into shared_ptr.
This operation has panic risk, because if the DataSet is not created by make_shared, but created in stack,
calling shared_from_this will cause bad_weakptr.
To avoid this kind of risk, need change all DataSet& to DataSetPtr in all knowhere APIs.
I would personally stick with std::shared_ptr<DataSet> instead of creating an alias 'DataSetPtr'. Just because it is confusing (DataSetPtr kinda implies DataSet*)
Also, const std::shared_ptr<DataSet> should be passed by ref, because passing shared_ptr by value adds an overhead of atomic increments and decrements of shared_ptr ref counters.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Reopen the issue with /reopen.
To support multi data type, PR #210 introduced IndexNodeDataMockWrapper::xxx, in which DataSet reference is converted into shared_ptr.
This operation has panic risk, because if the DataSet is not created by make_shared, but created in stack,
calling shared_from_this will cause bad_weakptr.
To avoid this kind of risk, need change all DataSet& to DataSetPtr in all knowhere APIs.
For details please check #210 and #659
The text was updated successfully, but these errors were encountered: