]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix a bug in IterKey 2.8.1.fb
authorsdong <siying.d@fb.com>
Thu, 24 Apr 2014 00:51:16 +0000 (17:51 -0700)
committersdong <siying.d@fb.com>
Thu, 24 Apr 2014 02:45:58 +0000 (19:45 -0700)
Summary: IterKey set buffer_size_ to a wrong initial value, causing it to always allocate values from heap instead of stack if the key size is smaller. Fix it.

Test Plan: make all check

Reviewers: haobo, ljin

Reviewed By: haobo

CC: igor, dhruba, yhchiang, leveldb
Differential Revision: https://reviews.facebook.net/D18279

db/dbformat.h

index 2bddd3f5681bc0d0d5c33f1cb635d991db921434..05adbd6561b78dd840adeebe7d1eda953a1101a1 100644 (file)
@@ -277,7 +277,7 @@ class IterKey {
       delete[] key_;
     }
     key_ = space_;
-    buf_size_ = sizeof(buf_size_);
+    buf_size_ = sizeof(space_);
     key_size_ = 0;
   }