]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
kv/RocksDBStore: use vector instead of VLA for holding slices 16615/head
authorKefu Chai <kchai@redhat.com>
Thu, 27 Jul 2017 02:34:43 +0000 (10:34 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 27 Jul 2017 02:44:50 +0000 (10:44 +0800)
commit3cab2ce1792977ff7f2fbfbef2f8bd609563b6df
tree61348e8f2fcbee533841034dc681e65ea9e726ca
parent6ce96c74740dc3b2a33feddb2ff4b3e72e0f16e0
kv/RocksDBStore: use vector instead of VLA for holding slices

clang complains:

ceph/src/kv/RocksDBStore.cc:611:32: error: variable length array of
non-POD element type
      'rocksdb::Slice'
    rocksdb::Slice value_slices[to_set_bl.buffers().size()];

and i believe GCC will also complains with: -Wvla or -pedantic. as
to_set_bl.buffers().size() is not a const expr at compile time.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/kv/RocksDBStore.cc