Merge pull request #8191 from jzhou77/fix-tuple

Make a new memory arena for Tuple::clear
This commit is contained in:
Jingyu Zhou 2022-09-15 17:35:05 -07:00 committed by GitHub
commit 1510124a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,9 @@ struct Tuple {
size_t size() const { return offsets.size(); }
void reserve(size_t cap) { offsets.reserve(cap); }
void clear() {
data.clear();
// Make a new Standalone to use different memory so that
// previously returned objects from pack() are valid.
data = Standalone<VectorRef<uint8_t>>();
offsets.clear();
}
// Return a Tuple encoded raw string.