diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2021-04-25 11:20:35 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2021-04-25 11:20:35 (GMT) |
commit | b63d1213ed575f5b179c1e9244ec808e2fe69b96 (patch) | |
tree | 7f999dfc4a751c45a0e9f69c81a8534e9f022716 /doc/Class.3 | |
parent | 2453c29945269ab4734362d7613c187d3e6e8fbb (diff) | |
download | tcl-b63d1213ed575f5b179c1e9244ec808e2fe69b96.zip tcl-b63d1213ed575f5b179c1e9244ec808e2fe69b96.tar.gz tcl-b63d1213ed575f5b179c1e9244ec808e2fe69b96.tar.bz2 |
Documenting our reference count management
Diffstat (limited to 'doc/Class.3')
-rw-r--r-- | doc/Class.3 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/Class.3 b/doc/Class.3 index 57203d5..5f8e061 100644 --- a/doc/Class.3 +++ b/doc/Class.3 @@ -241,6 +241,29 @@ NULL if the whole chain is to be processed (the argument itself is never NULL); this variable may be updated by the callback. The \fImethodNameObj\fR parameter gives an unshared object containing the name of the method being invoked, as provided by the user; this object may be updated by the callback. +.SH "REFERENCE COUNT MANAGEMENT" +.PP +The \fIobjPtr\fR argument to \fBTcl_GetObjectFromObj\fR will not have its +reference count manipulated, but this function may modify the interpreter +result (to report any error) so interpreter results should not be fed into +this without an additional reference being used. +.PP +The result of \fBTcl_GetObjectName\fR is a value that is owned by the object +that is regenerated when this function is first called after the object is +renamed. If the value is to be retained at all, the caller should increment +the reference count. +.PP +The first \fIobjc\fR values in the \fIobjv\fR argument to +\fBTcl_NewObjectInstance\fR are the arguments to pass to the constructor. They +must have a reference count of at least 1, and may have their reference counts +changed during the running of the constructor. Constructors may modify the +interpreter result, which consequently means that interpreter results should +not be used as arguments without an additional reference being taken. +.PP +The \fImethodNameObj\fR argument to a Tcl_ObjectMapMethodNameProc +implementation will be a value with a reference count of at least 1 where at +least one reference is not held by the interpreter result. It is expected that +method name mappers will only read their \fImethodNameObj\fR arguments. .SH "SEE ALSO" Method(3), oo::class(n), oo::copy(n), oo::define(n), oo::object(n) .SH KEYWORDS |