PERWAPI.Section.AddReloc C# (CSharp) Method

AddReloc() private method

private AddReloc ( uint offs ) : void
offs uint
return void
        internal void AddReloc(uint offs)
        {
            if (Diag.DiagOn) Console.WriteLine("Adding a reloc to " + nameString + " section");
            int pos = 0;
            if (relocs == null) {
                relocs = new uint[5];
            } else {
                if (relocTide >= relocs.Length) {
                    uint[] tmp = relocs;
                    relocs = new uint[tmp.Length + 5];
                    for (int i=0; i < relocTide; i++) {
                        relocs[i] = tmp[i];
                    }
                }
                while ((pos < relocTide) && (relocs[pos] < offs)) pos++;
                for (int i=pos; i < relocTide; i++) {
                    relocs[i+1] = relocs[i];
                }
            }
            relocs[pos] = offs;
            relocTide++;
            if (Diag.DiagOn) Console.WriteLine("relocTide = " + relocTide);
        }