summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-10-08 20:54:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-10-08 20:54:05 -0700
commit31aec9f2132701f741d8786950190980a792fd96 (patch)
treeb331db0c1b757ae21ecd237d5245d465a40e8c89 /lib.h
parent758a8d52fb20d976d7fc459aa6ca34242a6ec0ee (diff)
downloadtxr-31aec9f2132701f741d8786950190980a792fd96.tar.gz
txr-31aec9f2132701f741d8786950190980a792fd96.tar.bz2
txr-31aec9f2132701f741d8786950190980a792fd96.zip
strings: revert caching of hash value.
Research indicates that this is something useful in languages that abuse strings for implementing symbols. We have interned symbols. * lib.h (struct string): Remove hash member. * lib.c (string_own, string, string_utf8, mkustring, string_extend, replace_str, chr_str_set): Remove all initializations and updates of the removed hash member. * hash.c (equal_hash): Do not cache string hash value.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib.h b/lib.h
index 48320174..34f00c09 100644
--- a/lib.h
+++ b/lib.h
@@ -154,9 +154,7 @@ struct string {
obj_common;
wchar_t *str;
val len;
-#if HAVE_MALLOC_USABLE_SIZE
- ucnum hash;
-#else
+#if !HAVE_MALLOC_USABLE_SIZE
cnum alloc;
#endif
};