diff options
author | dgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529> | 2011-05-21 02:17:43 +0000 |
---|---|---|
committer | dgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529> | 2011-05-21 02:17:43 +0000 |
commit | da7990950787257cb312ca562ce5977749afc3e9 (patch) | |
tree | 91fe98f6e14e74c794392b22105a47a58499edff /db/write_batch_test.cc | |
parent | 3c111335a760d8d82414b91a54f740df09dd4f8f (diff) | |
download | leveldb-da7990950787257cb312ca562ce5977749afc3e9.tar.gz |
sync with upstream @ 21409451
Check the NEWS file for details of what changed.
git-svn-id: https://leveldb.googlecode.com/svn/trunk@28 62dab493-f737-651d-591e-8d6aee1b9529
Diffstat (limited to 'db/write_batch_test.cc')
-rw-r--r-- | db/write_batch_test.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/db/write_batch_test.cc b/db/write_batch_test.cc index 2bf1134..73d68fd 100644 --- a/db/write_batch_test.cc +++ b/db/write_batch_test.cc @@ -14,10 +14,11 @@ namespace leveldb { static std::string PrintContents(WriteBatch* b) { InternalKeyComparator cmp(BytewiseComparator()); - MemTable mem(cmp); + MemTable* mem = new MemTable(cmp); + mem->Ref(); std::string state; - Status s = WriteBatchInternal::InsertInto(b, &mem); - Iterator* iter = mem.NewIterator(); + Status s = WriteBatchInternal::InsertInto(b, mem); + Iterator* iter = mem->NewIterator(); for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { ParsedInternalKey ikey; ASSERT_TRUE(ParseInternalKey(iter->key(), &ikey)); @@ -42,6 +43,7 @@ static std::string PrintContents(WriteBatch* b) { if (!s.ok()) { state.append("ParseError()"); } + mem->Unref(); return state; } |