Skip to content
Snippets Groups Projects
Commit dd1981f3 authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

more debug added

Rev: src/stralloc.c:1.4
parent 4613e540
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,10 @@ static unsigned int StrHash(const char *s,int len) ...@@ -25,6 +25,10 @@ static unsigned int StrHash(const char *s,int len)
#ifdef DEBUG #ifdef DEBUG
void check_string(struct lpc_string *s) void check_string(struct lpc_string *s)
{ {
StrHash(s->str, s->len);
if(full_hash_value != s->hval)
fatal("Hash value changed?\n");
if(debug_findstring(s) !=s) if(debug_findstring(s) !=s)
fatal("Shared string not shared.\n"); fatal("Shared string not shared.\n");
...@@ -133,7 +137,7 @@ static struct lpc_string *propagate_shared_string(const struct lpc_string *s,int ...@@ -133,7 +137,7 @@ static struct lpc_string *propagate_shared_string(const struct lpc_string *s,int
#ifdef DEBUG #ifdef DEBUG
struct lpc_string *debug_findstring(const struct lpc_string *foo) struct lpc_string *debug_findstring(const struct lpc_string *foo)
{ {
return propagate_shared_string(foo, StrHash(foo->str, foo->len)); return propagate_shared_string(foo, foo->hval % HTABLE_SIZE);
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment