From: Donald G P. <dg...@ni...> - 2006-03-30 15:10:59
|
> From: "Dinesh Monga" <din...@xi...> > My Questions Are: > Is it valid to call Tcl_InvalidateStringRep in the client side code? > Does Tcl holds on to this string representation and expects that we > never release this memory? > If it is valid to call this method, what should be correct place to do > so? Your code should call Tcl_InvalidateStringRep(objPtr) only when it is changing the internal rep of objPtr to a new value that is inconsistent with the current string representation of objPtr. Such operations on the internal rep of a Tcl_Obj ought to be done only by the code that implements the Tcl_ObjType of that objPtr, or by closely releated routines in the spirit of Tcl_GetFooFromObj(). If you are using T_ISR for any other purpose, you are mis-using it. Whenever you're messing around with Tcl_Obj internals, also be sure you're properly managing reference counts with Tcl_(Incr|Decr)RefCount() calls, and take care to respect Tcl's Copy on Write rules for Tcl_Obj sharing. | Don Porter Mathematical and Computational Sciences Division | | don...@ni... Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| |