// Dereference the supplied HID in the supplied heap-on-node blocks, // and return the size of the resulting data buffer private int HidSize(List <HNDataBlock> blocks, HID hid) { var index = hid.GetIndex(ndb.IsUnicode4K); if (index == 0) // Check for empty { return(0); } var b = blocks[hid.GetBlockIndex(ndb.IsUnicode4K)]; return(b.rgibAlloc[index] - b.rgibAlloc[index - 1]); }
// Dereference the supplied HID in the supplied heap-on-node blocks, // and map the resulting data buffer onto an array of count occurrences of the specified type T private T[] MapArray <T>(List <HNDataBlock> blocks, HID hid, int count, int offset = 0) { var b = blocks[hid.GetBlockIndex(ndb.IsUnicode4K)]; return(Map.MapArray <T>(b.Buffer, b.rgibAlloc[hid.GetIndex(ndb.IsUnicode4K) - 1] + offset, count)); }