|
|
1 | #ifndef SHSTR_H__ |
|
|
2 | #define SHSTR_H__ |
|
|
3 | |
1 | /* The size of the shared strings hashtable. This must be smaller than |
4 | /* The size of the shared strings hashtable. This must be smaller than |
2 | * 32767, but 947 ought to be plenty enough. |
5 | * 32767, but 947 ought to be plenty enough. |
3 | */ |
6 | */ |
4 | #define TABLESIZE 4133 |
7 | #define TABLESIZE 4133 |
5 | |
8 | |
… | |
… | |
66 | * the padding when allocating memory. We assume here that |
69 | * the padding when allocating memory. We assume here that |
67 | * sizeof(long) is a good boundary. |
70 | * sizeof(long) is a good boundary. |
68 | */ |
71 | */ |
69 | char string[PADDING]; |
72 | char string[PADDING]; |
70 | } shared_string; |
73 | } shared_string; |
|
|
74 | |
|
|
75 | extern void init_hash_table(void); |
|
|
76 | extern const char *add_string(const char *str); |
|
|
77 | extern const char *add_refcount(const char *str); |
|
|
78 | extern int query_refcount(const char *str); |
|
|
79 | extern const char *find_string(const char *str); |
|
|
80 | extern void free_string(const char *str); |
|
|
81 | extern void ss_dump_statistics(void); |
|
|
82 | extern const char *ss_dump_table(int what); |
|
|
83 | extern int buf_overflow(const char *buf1, const char *buf2, int bufsize); |
|
|
84 | |
|
|
85 | #endif |
|
|
86 | |