50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
-
+
+
+
+
|
has effectively had its bucketPtr field replaced by a hash field but without
a version field in place. So long as callers do not directly touch either of
these fields, but leave them solely for the Tcl routines to operate on, then
the Tcl build-time configurability to use either implementation by setting
of <b>TCL_HASH_KEY_STORE_HASH</b> to 1 or not continues to be an
option. But that just underlines the point that these fields are functionally
meant to be private and accessed only by Tcl. Better to have form and
function in agreement.
function in agreement. There's evidence that at some point in the history
the Tcl_HashTable struct has also been extended (to grow the typePtr field).
That change also took place without benefit of a version field, so some
difficult to explain and maintain code is in Tcl_InitCustomHashTable.
The advantage of static Tcl_HashTable allocation by callers is diminished by
the fact that the routines in this module only function if thread isolation is
preserved. Any particular (Tcl_HashTable *) may only be passed into
these routines by a single thread. This suggests HashTables belong in thread
specific memory, which already removes the static option of storage. Having
a routine to actually allocate the hash table makes it clear from the beginning
|
84
85
86
87
88
89
90
|
87
88
89
90
91
92
93
94
95
96
97
|
+
+
+
+
|
tend to be costly in performance. It has been difficult to generate evidence
to support the claims of any alternatives to simultaneously perform well and
offer protection.
Other hashing criticisms have been raised occasionally that on some input sets,
the existing hashes do not randomize into the full 32 bits of hash value as well as
they should for best operations.
There are runtime configuration options for these routines that do away with
the dependence on [Allocation] as a runtime concern. This module can be
self-contained in that sense.
|