812
813 for (i = 0; i < IDENT_HASH_SIZE; i++) {
814 struct ident * ident = hash_table[i];
815 int count = 0;
816
817 while (ident) {
818 count++;
819 ident = ident->next;
820 }
821 if (count > 99)
822 count = 99;
823 distribution[count]++;
824 }
825
826 for (i = 0; i < 100; i++) {
827 if (distribution[i])
828 fprintf(stderr, "%2d: %d buckets\n", i, distribution[i]);
829 }
830 }
831
832 static struct ident *alloc_ident(const char *name, int len)
833 {
834 struct ident *ident = __alloc_ident(len);
835 ident->symbols = NULL;
836 ident->len = len;
837 ident->tainted = 0;
838 memcpy(ident->name, name, len);
839 return ident;
840 }
841
842 static struct ident * insert_hash(struct ident *ident, unsigned long hash)
843 {
844 ident->next = hash_table[hash];
845 hash_table[hash] = ident;
846 ident_miss++;
847 return ident;
848 }
849
850 static struct ident *create_hashed_ident(const char *name, int len, unsigned long hash)
851 {
852 struct ident *ident;
|
812
813 for (i = 0; i < IDENT_HASH_SIZE; i++) {
814 struct ident * ident = hash_table[i];
815 int count = 0;
816
817 while (ident) {
818 count++;
819 ident = ident->next;
820 }
821 if (count > 99)
822 count = 99;
823 distribution[count]++;
824 }
825
826 for (i = 0; i < 100; i++) {
827 if (distribution[i])
828 fprintf(stderr, "%2d: %d buckets\n", i, distribution[i]);
829 }
830 }
831
832 struct ident *alloc_ident(const char *name, int len)
833 {
834 struct ident *ident = __alloc_ident(len);
835 ident->symbols = NULL;
836 ident->len = len;
837 ident->tainted = 0;
838 memcpy(ident->name, name, len);
839 return ident;
840 }
841
842 static struct ident * insert_hash(struct ident *ident, unsigned long hash)
843 {
844 ident->next = hash_table[hash];
845 hash_table[hash] = ident;
846 ident_miss++;
847 return ident;
848 }
849
850 static struct ident *create_hashed_ident(const char *name, int len, unsigned long hash)
851 {
852 struct ident *ident;
|