Lines Matching refs:table
368 bfd_hash_table_init_n (struct bfd_hash_table *table, in bfd_hash_table_init_n() argument
385 table->memory = (void *) objalloc_create (); in bfd_hash_table_init_n()
386 if (table->memory == NULL) in bfd_hash_table_init_n()
391 table->table = (struct bfd_hash_entry **) in bfd_hash_table_init_n()
392 objalloc_alloc ((struct objalloc *) table->memory, alloc); in bfd_hash_table_init_n()
393 if (table->table == NULL) in bfd_hash_table_init_n()
395 bfd_hash_table_free (table); in bfd_hash_table_init_n()
399 memset ((void *) table->table, 0, alloc); in bfd_hash_table_init_n()
400 table->size = size; in bfd_hash_table_init_n()
401 table->entsize = entsize; in bfd_hash_table_init_n()
402 table->count = 0; in bfd_hash_table_init_n()
403 table->frozen = 0; in bfd_hash_table_init_n()
404 table->newfunc = newfunc; in bfd_hash_table_init_n()
411 bfd_hash_table_init (struct bfd_hash_table *table, in bfd_hash_table_init() argument
417 return bfd_hash_table_init_n (table, newfunc, entsize, in bfd_hash_table_init()
424 bfd_hash_table_free (struct bfd_hash_table *table) in bfd_hash_table_free() argument
426 objalloc_free ((struct objalloc *) table->memory); in bfd_hash_table_free()
427 table->memory = NULL; in bfd_hash_table_free()
457 bfd_hash_lookup (struct bfd_hash_table *table, in bfd_hash_lookup() argument
468 _index = hash % table->size; in bfd_hash_lookup()
469 for (hashp = table->table[_index]; in bfd_hash_lookup()
485 new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory, in bfd_hash_lookup()
496 return bfd_hash_insert (table, string, hash); in bfd_hash_lookup()
502 bfd_hash_insert (struct bfd_hash_table *table, in bfd_hash_insert() argument
509 hashp = (*table->newfunc) (NULL, table, string); in bfd_hash_insert()
514 _index = hash % table->size; in bfd_hash_insert()
515 hashp->next = table->table[_index]; in bfd_hash_insert()
516 table->table[_index] = hashp; in bfd_hash_insert()
517 table->count++; in bfd_hash_insert()
519 if (!table->frozen && table->count > table->size * 3 / 4) in bfd_hash_insert()
521 unsigned long newsize = higher_prime_number (table->size); in bfd_hash_insert()
530 table->frozen = 1; in bfd_hash_insert()
535 objalloc_alloc ((struct objalloc *) table->memory, alloc)); in bfd_hash_insert()
538 table->frozen = 1; in bfd_hash_insert()
543 for (hi = 0; hi < table->size; hi ++) in bfd_hash_insert()
544 while (table->table[hi]) in bfd_hash_insert()
546 struct bfd_hash_entry *chain = table->table[hi]; in bfd_hash_insert()
552 table->table[hi] = chain_end->next; in bfd_hash_insert()
557 table->table = newtable; in bfd_hash_insert()
558 table->size = newsize; in bfd_hash_insert()
567 bfd_hash_rename (struct bfd_hash_table *table, in bfd_hash_rename() argument
574 _index = ent->hash % table->size; in bfd_hash_rename()
575 for (pph = &table->table[_index]; *pph != NULL; pph = &(*pph)->next) in bfd_hash_rename()
584 _index = ent->hash % table->size; in bfd_hash_rename()
585 ent->next = table->table[_index]; in bfd_hash_rename()
586 table->table[_index] = ent; in bfd_hash_rename()
592 bfd_hash_replace (struct bfd_hash_table *table, in bfd_hash_replace() argument
599 _index = old->hash % table->size; in bfd_hash_replace()
600 for (pph = &table->table[_index]; in bfd_hash_replace()
617 bfd_hash_allocate (struct bfd_hash_table *table, in bfd_hash_allocate() argument
622 ret = objalloc_alloc ((struct objalloc *) table->memory, size); in bfd_hash_allocate()
632 struct bfd_hash_table *table, in bfd_hash_newfunc() argument
636 entry = (struct bfd_hash_entry *) bfd_hash_allocate (table, in bfd_hash_newfunc()
644 bfd_hash_traverse (struct bfd_hash_table *table, in bfd_hash_traverse() argument
650 table->frozen = 1; in bfd_hash_traverse()
651 for (i = 0; i < table->size; i++) in bfd_hash_traverse()
655 for (p = table->table[i]; p != NULL; p = p->next) in bfd_hash_traverse()
660 table->frozen = 0; in bfd_hash_traverse()
709 struct bfd_hash_table table; member
725 struct bfd_hash_table *table, in strtab_hash_newfunc() argument
733 ret = (struct strtab_hash_entry *) bfd_hash_allocate (table, in strtab_hash_newfunc()
740 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string); in strtab_hash_newfunc()
756 bfd_hash_lookup (&(t)->table, (string), (create), (copy)))
763 struct bfd_strtab_hash *table; in _bfd_stringtab_init() local
764 bfd_size_type amt = sizeof (* table); in _bfd_stringtab_init()
766 table = (struct bfd_strtab_hash *) bfd_malloc (amt); in _bfd_stringtab_init()
767 if (table == NULL) in _bfd_stringtab_init()
770 if (!bfd_hash_table_init (&table->table, strtab_hash_newfunc, in _bfd_stringtab_init()
773 free (table); in _bfd_stringtab_init()
777 table->size = 0; in _bfd_stringtab_init()
778 table->first = NULL; in _bfd_stringtab_init()
779 table->last = NULL; in _bfd_stringtab_init()
780 table->xcoff = FALSE; in _bfd_stringtab_init()
782 return table; in _bfd_stringtab_init()
803 _bfd_stringtab_free (struct bfd_strtab_hash *table) in _bfd_stringtab_free() argument
805 bfd_hash_table_free (&table->table); in _bfd_stringtab_free()
806 free (table); in _bfd_stringtab_free()
830 entry = (struct strtab_hash_entry *) bfd_hash_allocate (&tab->table, in _bfd_stringtab_add()
841 n = (char *) bfd_hash_allocate (&tab->table, len); in _bfd_stringtab_add()