Exemple #1
0
 protected void InitializeHeader(StaticHashTableFileHeader *headerPointer)
 {
     headerPointer->DistanceSum = 0;
     headerPointer->Magic       = StaticHashTableFileHeader.MagicNumber;
     headerPointer->MaxDistance = 0;
     headerPointer->RecordCount = 0;
     headerPointer->RecordSize  = config.RecordSize;
     headerPointer->SlotCount   = sizeState.SlotCount;
 }
Exemple #2
0
 protected void ValidateHeader(StaticHashTableFileHeader *headerPointer)
 {
     if (headerPointer->Magic != StaticHashTableFileHeader.MagicNumber)
     {
         throw new FormatException($"This is not a {nameof(AbstractDynamicStore<TKey, TValue>)} file");
     }
     if (headerPointer->RecordSize != config.RecordSize)
     {
         throw new ArgumentException("Mismatched RecordSize");
     }
 }