Split SHAMapTreeNode into leaf and inner nodes.

* This reduces the memory requirements of both leaf and inner nodes.
* The name SHAMapTreeNode is retained for leaf nodes so as to keep
  the public API of SHAMap stable.
This commit is contained in:
Howard Hinnant
2015-06-05 20:47:30 -04:00
committed by Nik Bougalis
parent e95ab65396
commit f875603525
11 changed files with 739 additions and 582 deletions

View File

@@ -235,16 +235,16 @@ public:
if (!node.has_nodeid () || !node.has_nodedata ())
return;
SHAMapTreeNode newNode(
auto newNode = SHAMapAbstractNode::make(
Blob (node.nodedata().begin(), node.nodedata().end()),
0, snfWIRE, uZero, false);
s.erase();
newNode.addRaw(s, snfPREFIX);
newNode->addRaw(s, snfPREFIX);
auto blob = std::make_shared<Blob> (s.begin(), s.end());
getApp().getOPs().addFetchPack (newNode.getNodeHash(), blob);
getApp().getOPs().addFetchPack (newNode->getNodeHash(), blob);
}
}
catch (...)