Fix memorty leak in rocksdb_wal_iter_get_batch function#5515
Fix memorty leak in rocksdb_wal_iter_get_batch function#5515JimChengLin wants to merge 2 commits intofacebook:masterfrom
rocksdb_wal_iter_get_batch function#5515Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
riversand963
left a comment
There was a problem hiding this comment.
LGTM. Thanks @JimChengLin for the fix
facebook-github-bot
left a comment
There was a problem hiding this comment.
@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@riversand963 merged this pull request in cd25203. |
) Summary: `wal_batch.writeBatchPtr.release()` gives up the ownership of the original `WriteBatch`, but there is no new owner, which causes memory leak. The patch is simple. Removing `release()` prevent ownership change. `std::move` is for speed. Pull Request resolved: facebook#5515 Differential Revision: D16264281 Pulled By: riversand963 fbshipit-source-id: 51c556b7a1c977325c3aa24acb636303847151fa
wal_batch.writeBatchPtr.release()gives up the ownership of the originalWriteBatch, but there is no new owner, which causes memory leak.The patch is simple. Removing
release()prevent ownership change.std::moveis for speed.