newInterp = Tcl_CreateInterp();
In the Tcl sources, I found that evaluation of scripts in an interpreter
occurs inside is a surrounding pair of Tcl_Preserve(newInterp) and
Tcl_Release(newInterp). The reason for this may be given by the manual
page for Tcl_CreateInterp(), which says:
"...
Tcl implements a simple mechanism that allows callers to use
interpreters without worrying about the interpreter being deleted in a
nested call.
..."
My question is:
"Does a pair of Tcl_Preserve(newInterp) and
Tcl_Release(newInterp) protect against anything else besides nested
attempts to interp deletion?
The reason I ask is that, in my case, I believe to have complete control
over the code executed by the new interpreter. I also believe to know
that there is no code that deletes the interpreter. If that is true,
then I might safely omit the Tcl_Preserve/Tcl_Release pair.
However, if the Tcl_Preserve/Tcl_Release pair protects against other
things as well, then I may be wrong to omit them.
Thanks in advance for any insight,
Erik Leunissen
--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.
If you really do have complete control over the code executed
by the new interpreter, then no: Tcl_Preserve()/Tcl_Release()
isn't necessary.
--JE
Thanks for the clarity Joe.
B.t.w: something amiss with my news group access. I only saw your answer
today 24-Sep-2007. When checking this "thread" (at most) three days ago,
I didn't see your post, although it is dated at 14_sep-2007.
So much for communication latency.
Erik