summaryrefslogtreecommitdiffstats
path: root/doc/StringObj.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/StringObj.3
parentaa1949c4f3d10fedc5209ff5c34a9f6d2442293e (diff)
parent42a77f7b4b1e4f3699d71cd2cf9fe6de7e9e4d71 (diff)
downloadtcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.zip
tcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.tar.gz
tcl-8d556345fd97eb9d60d2e7e1e372e1cc52939ff5.tar.bz2
merge core-8-branch
Diffstat (limited to 'doc/StringObj.3')
-rw-r--r--doc/StringObj.327
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 10e747f..7db739d 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -374,6 +374,33 @@ white space, then that value is ignored entirely. This white-space
removal was added to make the output of the \fBconcat\fR command
cleaner-looking. \fBTcl_ConcatObj\fR returns a pointer to a
newly-created value whose ref count is zero.
+.SH "REFERENCE COUNT MANAGEMENT"
+.PP
+\fBTcl_NewStringObj\fR, \fBTcl_NewUnicodeObj\fB, \fBTcl_Format\fR,
+\fBTcl_ObjPrintf\fR, and \fBTcl_ConcatObj\fR always return a zero-reference
+object, much like \fBTcl_NewObj\fR.
+.PP
+\fBTcl_GetStringFromObj\fR, \fBTcl_GetString\fR, \fBTcl_GetUnicodeFromObj\fR,
+\fBTcl_GetUnicode\fR, \fBTcl_GetUniChar\fR, \fBTcl_GetCharLength\fR, and
+\fBTcl_GetRange\fR all only work with an existing value; they do not
+manipulate its reference count in any way.
+.PP
+\fBTcl_SetStringObj\fR, \fBTcl_SetUnicodeObj\fR, \fBTcl_AppendToObj\fR,
+\fBTcl_AppendUnicodeToObj\fR, \fBTcl_AppendObjToObj\fR,
+\fBTcl_AppendStringsToObj\fR, \fBTcl_AppendStringsToObjVA\fR,
+\fBTcl_AppendLimitedToObj\fR, \fBTcl_AppendFormatToObj\fR,
+\fBTcl_AppendPrintfToObj\fR, \fBTcl_SetObjLength\fR, and
+\fBTcl_AttemptSetObjLength\fR and require their \fIobjPtr\fR to be an unshared
+value (i.e, a reference count no more than 1) as they will modify it.
+.PP
+Additional arguments to the above functions (the \fIappendObjPtr\fR argument
+to \fBTcl_AppendObjToObj\fR, values in the \fIobjv\fR argument to
+\fBTcl_Format\fR, \fBTcl_AppendFormatToObj\fR, and \fBTcl_ConcatObj\fR) can
+have any reference count, but reference counts of zero are not recommended.
+.PP
+\fBTcl_Format\fR and \fBTcl_AppendFormatToObj\fR may modify the interpreter
+result, which involves changing the reference count of a value.
+
.SH "SEE ALSO"
Tcl_NewObj(3), Tcl_IncrRefCount(3), Tcl_DecrRefCount(3), format(n), sprintf(3)
.SH KEYWORDS