summaryrefslogtreecommitdiffstats
path: root/doc/Hash.3
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2021-04-26 07:58:16 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2021-04-26 07:58:16 (GMT)
commit8d556345fd97eb9d60d2e7e1e372e1cc52939ff5 (patch)
tree6a816b87f19ec34be25a0f50066990db21455624 /doc/Hash.3
parentaa1949c4f3d10fedc5209ff5c34a9f6d2442293e (diff)
parent42a77f7b4b1e4f3699d71cd2cf9fe6de7e9e4d71 (diff)
downloadtcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.zip
tcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.tar.gz
tcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.tar.bz2
merge core-8-branch
Diffstat (limited to 'doc/Hash.3')
-rw-r--r--doc/Hash.314
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/Hash.3 b/doc/Hash.3
index c3ef6b3..6481f64 100644
--- a/doc/Hash.3
+++ b/doc/Hash.3
@@ -324,5 +324,19 @@ typedef void \fBTcl_FreeHashEntryProc\fR(
If this is NULL then \fBTcl_Free\fR is used to free the space for the entry.
Tcl_Obj* keys use this function to decrement the reference count on the
value.
+.SH "REFERENCE COUNT MANAGEMENT"
+.PP
+When a hash table is created with \fBTcl_InitCustomHashTable\fR, the
+\fBTcl_CreateHashEntry\fR function will increment the reference count of its
+\fIkey\fR argument when it creates a key (but not if there is an existing
+matching key). The reference count of the key will be decremented when the
+corresponding hash entry is deleted, whether with \fBTcl_DeleteHashEntry\fR or
+with \fBTcl_DeleteHashTable\fR. The \fBTcl_GetHashKey\fR function will return
+the key without further modifying its reference count.
+.PP
+Custom hash tables that use a Tcl_Obj* as key will generally need to do
+something similar in their \fIallocEntryProc\fR.
+.SH "SEE ALSO"
+Dict(3)
.SH KEYWORDS
hash table, key, lookup, search, value