From f3db9ef8b95aa3c5c4db6b8e25782bcd2f667eb6 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 25 Apr 2015 00:31:05 +0200 Subject: [PATCH] Fill new blocks with zeroes --- implementations/onblocks/datanodestore/DataNodeStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementations/onblocks/datanodestore/DataNodeStore.cpp b/implementations/onblocks/datanodestore/DataNodeStore.cpp index b83e0534..ea238431 100644 --- a/implementations/onblocks/datanodestore/DataNodeStore.cpp +++ b/implementations/onblocks/datanodestore/DataNodeStore.cpp @@ -41,13 +41,13 @@ unique_ptr DataNodeStore::load(unique_ptr block) { unique_ptr DataNodeStore::createNewInnerNode(const DataNode &first_child) { assert(first_child.node().layout().blocksizeBytes() == _layout.blocksizeBytes()); // This might be violated if source is from a different DataNodeStore //TODO Initialize block and then create it in the blockstore - this is more efficient than creating it and then writing to it - auto block = _blockstore->create(Data(_layout.blocksizeBytes())); + auto block = _blockstore->create(Data(_layout.blocksizeBytes()).FillWithZeroes()); return DataInnerNode::InitializeNewNode(std::move(block), first_child); } unique_ptr DataNodeStore::createNewLeafNode() { //TODO Initialize block and then create it in the blockstore - this is more efficient than creating it and then writing to it - auto block = _blockstore->create(Data(_layout.blocksizeBytes())); + auto block = _blockstore->create(Data(_layout.blocksizeBytes()).FillWithZeroes()); return DataLeafNode::InitializeNewNode(std::move(block)); }