This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix elf-strtab.c performance problem


On Mon, Dec 17, 2001 at 07:04:16PM +0100, Jakub Jelinek wrote:
> 
> 	* elf-strtab.c (struct elf_strtab_hash_entry): Add u.next.
> 	(last_eq): Remove.
> 	(_bfd_elf_strtab_finalize): Don't use a hash table for last
> 	character chains, instead use an array.

OK.

> +      c = e->root.string[e->len - 2] & 0xff;
> +      /* Put longest strings first.  */

Errant comment?

Also, a slightly more tidy way to add to lists, but please yourself over
this suggestion:

  struct elf_strtab_hash_entry **last_ptr[256];
.
.
  for (i = 0; i < 256; i++)
    last_ptr[i] = &last[i];
.
.
  *last_ptr[i] = e;
  last_ptr[i] = &e->next;

Alan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]