Walter Bright: > elf_findstr definitely looks like a problem area. I can't look at it right > now, > so can you post this to bugzilla please?
I am able to find two versions of elf_findstr, one in elfobj.c and one in machobj.c, so it may be possible to remove one of them. Its docstring doesn't seem to show the 'suffix' argument. I have seen that it performs strlen() of str and suffix at the beginning, so using fat pointers (C structs that keep ptr + len) as D may be enough to avoid those strelen calls and save some time. >From what I see it seems to perform a linear search inside an Outbuffer, >something like a search of strtab~strs inside an array of strings, so the >structure may be replaced by an associative set or ordered set lookup instead. Bye, bearophile