提交 39fb88f1 编写于 作者: M Maysam Yabandeh 提交者: Facebook Github Bot

Reset size_ to 0 in PinnableSlice::Reset (#4962)

Summary:
It would avoid bugs if the reused PinnableSlice is not actually reassigned and yet the programmer makes conclusions based on the size of the Slice.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4962

Differential Revision: D14012710

Pulled By: maysamyabandeh

fbshipit-source-id: 23f4e173386b5461fd5650f44cde470805f4e816
上级 1a761e6a
......@@ -202,6 +202,7 @@ class PinnableSlice : public Slice, public Cleanable {
void Reset() {
Cleanable::Reset();
pinned_ = false;
size_ = 0;
}
inline std::string* GetSelf() { return buf_; }
......@@ -255,4 +256,4 @@ inline size_t Slice::difference_offset(const Slice& b) const {
return off;
}
} // namespace rocksdb
\ No newline at end of file
} // namespace rocksdb
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册