00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 typedef struct hash_table {
00032 unsigned long size;
00033 unsigned long contains;
00034 void **table;
00035 } Hash_Table;
00036
00037
00038
00039
00040
00041
00042 extern Hash_Table symbol_table;
00043 extern Hash_Table string_table;
00044
00045
00046
00047
00048
00049
00050 #ifndef DEBUG_ASSERTIONS
00051 #define string_table_increment_and_check_for_overflow \
00052 { \
00053 string_table.contains++; \
00054 if (string_table.contains > (string_table.size << 2)) \
00055 expand_string_table(); \
00056 }
00057
00058 #define symbol_table_increment_and_check_for_overflow \
00059 { \
00060 symbol_table.contains++; \
00061 if (symbol_table.contains > (symbol_table.size << 2)) \
00062 expand_symbol_table(); \
00063 }
00064
00065 #else
00066
00067 #define string_table_increment_and_check_for_overflow \
00068 { \
00069 string_table.contains++; \
00070 if (string_table.contains > (string_table.size << 2)) { \
00071 printf("\nBEFORE:\n"); \
00072 string_table_stats(); \
00073 expand_string_table(); \
00074 printf("\nAFTER:\n"); \
00075 string_table_stats(); \
00076 } \
00077 }
00078
00079 #define symbol_table_increment_and_check_for_overflow \
00080 { \
00081 symbol_table.contains++; \
00082 if (symbol_table.contains > (symbol_table.size << 2)) { \
00083 printf("\nBEFORE:\n"); \
00084 symbol_table_stats(); \
00085 expand_symbol_table(); \
00086 printf("\nAFTER:\n"); \
00087 symbol_table_stats(); \
00088 } \
00089 }
00090 #endif
00091
00092
00093
00094
00095
00096
00097 unsigned long next_prime(unsigned long some_integer);
00098 unsigned long hash(char *atom_name, byte arity, word hash_table_size);
00099 void expand_symbol_table();
00100 void expand_string_table();
00101 void symbol_table_stats();
00102 void string_table_stats();