The vector rep implementation was segfaulting because of incorrect initialization of vector.

Summary:
The constructor for Vector memtable has a parameter called 'count'
that specifies the capacity of the vector to be reserved at allocation
time. It was incorrectly used to initialize the size of the vector.

Test Plan: Enhanced db_test.

Reviewers: haobo, xjin, emayanke

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D13083
This commit is contained in:
Dhruba Borthakur
2013-09-24 22:23:19 -07:00
parent 87d6eb2f6b
commit f1a60e5c3e
3 changed files with 4 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ class MemTableRepFactory {
// Parameters:
// count: Passed to the constructor of the underlying std::vector of each
// VectorRep. On initialization, the underlying array will be at least count
// size.
// bytes reserved for usage.
class VectorRepFactory : public MemTableRepFactory {
const size_t count_;
public: