public int Alloc(int size) { int index = n; int len = arr.Length; if (n + size >= len) { byte[] aux = new byte[len + BLOCK_SIZE]; Array.Copy(arr, 0, aux, 0, len); arr = aux; } n += size; return index; }
public HyphenationTree() { stoplist = new Dictionary<string,List<object>>(23); // usually a small table classmap = new TernaryTree(); vspace = new ByteVector(); vspace.Alloc(1); // this reserves index 0, which we don't use }