diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2006-09-30 19:00:11 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2006-09-30 19:00:11 (GMT) |
commit | 25eaf268205e1fd47ec88e2323b0c8806f1b617a (patch) | |
tree | 57fe07a36dd760af3a032e5be075bc392479e90c /generic/tclInt.h | |
parent | 7d238aee5a63e4f16bafa9863ec090f904e66df2 (diff) | |
download | tcl-25eaf268205e1fd47ec88e2323b0c8806f1b617a.zip tcl-25eaf268205e1fd47ec88e2323b0c8806f1b617a.tar.gz tcl-25eaf268205e1fd47ec88e2323b0c8806f1b617a.tar.bz2 |
* generic/tclInt.decls:
* generic/tclInt.h:
* generic/tclIntDecls.h:
* generic/tclObj.c:
* generic/tclStubInit.c: added an internal function
TclObjBeingDeleted to provide info as to the reason for the loss
of an internal rep. [FR 1512138]
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index a3d6f48..6c45660 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.278 2006/09/30 17:56:47 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.279 2006/09/30 19:00:12 msofer Exp $ */ #ifndef _TCLINT @@ -2646,15 +2646,20 @@ MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr); (objPtr)->length = 0; \ (objPtr)->typePtr = NULL +/* Invalidate the string rep first so we can use the bytes value \ + * for our pointer chain, and signal an obj deletion (as opposed \ + * to shimmering) with 'length == -1' */ \ + # define TclDecrRefCount(objPtr) \ if (--(objPtr)->refCount <= 0) { \ if ((objPtr)->typePtr && (objPtr)->typePtr->freeIntRepProc) { \ TclFreeObj(objPtr); \ } else { \ - if ((objPtr)->bytes \ - && ((objPtr)->bytes != tclEmptyStringRep)) { \ - ckfree((char *) (objPtr)->bytes); \ + if ((objPtr)->bytes \ + && ((objPtr)->bytes != tclEmptyStringRep)) { \ + ckfree((char *) (objPtr)->bytes); \ } \ + (objPtr)->length = -1; \ TclFreeObjStorage(objPtr); \ TclIncrObjsFreed(); \ } \ |