From: sdong Date: Thu, 24 Apr 2014 00:51:16 +0000 (-0700) Subject: Fix a bug in IterKey X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2F2.8.1.fb;p=rocksdb.git Fix a bug in IterKey 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 --- diff --git a/db/dbformat.h b/db/dbformat.h index 2bddd3f5..05adbd65 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -277,7 +277,7 @@ class IterKey { delete[] key_; } key_ = space_; - buf_size_ = sizeof(buf_size_); + buf_size_ = sizeof(space_); key_size_ = 0; }