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()
458 bfd_hash_lookup (struct bfd_hash_table *table, in bfd_hash_lookup() argument
469 _index = hash % table->size; in bfd_hash_lookup()
470 for (hashp = table->table[_index]; in bfd_hash_lookup()
486 new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory, in bfd_hash_lookup()
497 return bfd_hash_insert (table, string, hash); in bfd_hash_lookup()
503 bfd_hash_insert (struct bfd_hash_table *table, in bfd_hash_insert() argument
510 hashp = (*table->newfunc) (NULL, table, string); in bfd_hash_insert()
515 _index = hash % table->size; in bfd_hash_insert()
516 hashp->next = table->table[_index]; in bfd_hash_insert()
517 table->table[_index] = hashp; in bfd_hash_insert()
518 table->count++; in bfd_hash_insert()
520 if (!table->frozen && table->count > table->size * 3 / 4) in bfd_hash_insert()
522 unsigned long newsize = higher_prime_number (table->size); in bfd_hash_insert()
531 table->frozen = 1; in bfd_hash_insert()
536 objalloc_alloc ((struct objalloc *) table->memory, alloc)); in bfd_hash_insert()
539 table->frozen = 1; in bfd_hash_insert()
544 for (hi = 0; hi < table->size; hi ++) in bfd_hash_insert()
545 while (table->table[hi]) in bfd_hash_insert()
547 struct bfd_hash_entry *chain = table->table[hi]; in bfd_hash_insert()
553 table->table[hi] = chain_end->next; in bfd_hash_insert()
558 table->table = newtable; in bfd_hash_insert()
559 table->size = newsize; in bfd_hash_insert()
568 bfd_hash_rename (struct bfd_hash_table *table, in bfd_hash_rename() argument
575 _index = ent->hash % table->size; in bfd_hash_rename()
576 for (pph = &table->table[_index]; *pph != NULL; pph = &(*pph)->next) in bfd_hash_rename()
585 _index = ent->hash % table->size; in bfd_hash_rename()
586 ent->next = table->table[_index]; in bfd_hash_rename()
587 table->table[_index] = ent; in bfd_hash_rename()
593 bfd_hash_replace (struct bfd_hash_table *table, in bfd_hash_replace() argument
600 _index = old->hash % table->size; in bfd_hash_replace()
601 for (pph = &table->table[_index]; in bfd_hash_replace()
618 bfd_hash_allocate (struct bfd_hash_table *table, in bfd_hash_allocate() argument
623 ret = objalloc_alloc ((struct objalloc *) table->memory, size); in bfd_hash_allocate()
633 struct bfd_hash_table *table, in bfd_hash_newfunc() argument
637 entry = (struct bfd_hash_entry *) bfd_hash_allocate (table, in bfd_hash_newfunc()
645 bfd_hash_traverse (struct bfd_hash_table *table, in bfd_hash_traverse() argument
651 table->frozen = 1; in bfd_hash_traverse()
652 for (i = 0; i < table->size; i++) in bfd_hash_traverse()
656 for (p = table->table[i]; p != NULL; p = p->next) in bfd_hash_traverse()
661 table->frozen = 0; in bfd_hash_traverse()
710 struct bfd_hash_table table; member
726 struct bfd_hash_table *table, in strtab_hash_newfunc() argument
734 ret = (struct strtab_hash_entry *) bfd_hash_allocate (table, in strtab_hash_newfunc()
741 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string); in strtab_hash_newfunc()
757 bfd_hash_lookup (&(t)->table, (string), (create), (copy)))
764 struct bfd_strtab_hash *table; in _bfd_stringtab_init() local
765 bfd_size_type amt = sizeof (* table); in _bfd_stringtab_init()
767 table = (struct bfd_strtab_hash *) bfd_malloc (amt); in _bfd_stringtab_init()
768 if (table == NULL) in _bfd_stringtab_init()
771 if (!bfd_hash_table_init (&table->table, strtab_hash_newfunc, in _bfd_stringtab_init()
774 free (table); in _bfd_stringtab_init()
778 table->size = 0; in _bfd_stringtab_init()
779 table->first = NULL; in _bfd_stringtab_init()
780 table->last = NULL; in _bfd_stringtab_init()
781 table->xcoff = FALSE; in _bfd_stringtab_init()
783 return table; in _bfd_stringtab_init()
804 _bfd_stringtab_free (struct bfd_strtab_hash *table) in _bfd_stringtab_free() argument
806 bfd_hash_table_free (&table->table); in _bfd_stringtab_free()
807 free (table); in _bfd_stringtab_free()
831 entry = (struct strtab_hash_entry *) bfd_hash_allocate (&tab->table, in _bfd_stringtab_add()
842 n = (char *) bfd_hash_allocate (&tab->table, len); in _bfd_stringtab_add()