Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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;
        }