+ nodeSize = S16(headerNode->header.nodeSize);
+ /*
+ * There are three cases here:
+ * nodeSize == vBlockSize;
+ * nodeSize > vBlockSize;
+ * nodeSize < vBlockSize.
+ * For the first two, everything is easy: we just need to read in a nodeSize, and that
+ * contains everything we care about. For the third case, however, we will
+ * need to read in an allocation block size, but then have GetNode move memory
+ * around so the node we want is at the beginning of the buffer. Note that this
+ * does mean it is less efficient than it should be.
+ */
+ if (nodeSize < vBlockSize) {
+ blocksPerNode = 1; // 1 block will hold multiple nodes
+ bufferSize = vBlockSize;
+ } else {
+ blocksPerNode = nodeSize / vBlockSize;
+ bufferSize = nodeSize;
+ }