]> git.llucax.com Git - z.facultad/75.52/treemulator.git/commitdiff
Actualizacion de los headers del nodo
authorRicardo Markiewicz <rmarkie@fi.uba.ar>
Tue, 13 Sep 2005 17:37:21 +0000 (17:37 +0000)
committerRicardo Markiewicz <rmarkie@fi.uba.ar>
Tue, 13 Sep 2005 17:37:21 +0000 (17:37 +0000)
src/btree.cpp

index 38873c683b368bb0e39d3ff58f248d21a4a5448b..5df88a2dc4b6156afa1e39f14f1fc148c1a9770e 100644 (file)
@@ -134,10 +134,15 @@ void BTree::WriteKeys (uchar *node, BTreeNodeHeader &node_header, std::list<BTre
 
        node += sizeof (BTreeNodeHeader);
 
+       node_header.item_count = 0;
+       node_header.free_space = header.block_size - sizeof (BTreeNodeHeader);
+
        while (it != keys.end ()) {
                BTreeData d = (*it);
                memcpy (node, d.ToArray(), d.Size ());
                node += d.Size ();
+               node_header.free_space -= d.Size ();
+               node_header.item_count++;
                it++;
        }