Beispiel #1
0
        private void SetNodeVector(int size)
        {
            if (size == 0)
            {
                HashPart = DummyHashPart;
                LastFree = size;
                return;
            }

            int lsize = CeilLog2(size);

            if (lsize > MAXBITS)
            {
                L.G_RunError("table overflow");
            }

            size     = (1 << lsize);
            HashPart = new HNode[size];
            for (int i = 0; i < size; ++i)
            {
                HashPart[i]       = new HNode();
                HashPart[i].Index = i;
                HashPart[i].Key   = new StkId();
                HashPart[i].Key.V.SetNilValue();
                HashPart[i].Val = new StkId();
                HashPart[i].Val.V.SetNilValue();
                HashPart[i].Next = null;
            }
            LastFree = size;
        }