From dd1981f31c5cfa9c60ad0ddbd23c806576f9e9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Mon, 12 Aug 1996 18:52:16 +0200 Subject: [PATCH] more debug added Rev: src/stralloc.c:1.4 --- src/stralloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stralloc.c b/src/stralloc.c index 6e5847e891..f6d77b5f10 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -25,6 +25,10 @@ static unsigned int StrHash(const char *s,int len) #ifdef DEBUG 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) fatal("Shared string not shared.\n"); @@ -133,7 +137,7 @@ static struct lpc_string *propagate_shared_string(const struct lpc_string *s,int #ifdef DEBUG 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 -- GitLab