void ReportUtilizationRate() { var zeros = 0; for (int i = 0; i < MaxBaseCheckIndex; i++) { if (BaseBuffer[i] == 0) { zeros++; } } ProgressLog.Println("trie memory utilization ratio (" + (!Compact ? "not " : "") + "compacted): " + ((MaxBaseCheckIndex - zeros) / (float)MaxBaseCheckIndex)); }
void ExtendBuffers(int nextIndex) { var newLength = nextIndex + (int)(BaseBuffer.Length * BufferGrowthPercentage); ProgressLog.Println("Buffers extended to " + BaseBuffer.Length + " entries"); var tmp = BaseBuffer; Array.Resize(ref tmp, newLength); BaseBuffer = tmp; tmp = CheckBuffer; Array.Resize(ref tmp, newLength); CheckBuffer = tmp; }