diff options
-rw-r--r-- | S4-0-2/tclCompile.h | 4 | ||||
-rw-r--r-- | S4-0-2/tclExecute.c | 4 | ||||
-rw-r--r-- | S4-0-2/tclExecute.h | 2 | ||||
-rw-r--r-- | S4-0-2/tclInt.h | 41 | ||||
-rw-r--r-- | generic/tclCompile.h | 4 | ||||
-rw-r--r-- | generic/tclExecute.c | 4 | ||||
-rw-r--r-- | generic/tclInt.h | 41 |
7 files changed, 93 insertions, 7 deletions
diff --git a/S4-0-2/tclCompile.h b/S4-0-2/tclCompile.h index 121ea9f..1df7c26 100644 --- a/S4-0-2/tclCompile.h +++ b/S4-0-2/tclCompile.h @@ -7,7 +7,9 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.h,v 1.1.2.1 2001/05/19 16:25:55 msofer Exp $ + * Up-to-date with 1.15 + * + * RCS: @(#) $Id: tclCompile.h,v 1.1.2.2 2001/07/13 21:25:00 msofer Exp $ */ #ifndef _TCLCOMPILATION diff --git a/S4-0-2/tclExecute.c b/S4-0-2/tclExecute.c index 2a80a46..7d4aaac 100644 --- a/S4-0-2/tclExecute.c +++ b/S4-0-2/tclExecute.c @@ -17,7 +17,9 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.1.2.3 2001/07/13 17:03:46 msofer Exp $ + * Up-to-date with 1.25; missing the read-traces firing new in 1.26 + * + * RCS: @(#) $Id: tclExecute.c,v 1.1.2.4 2001/07/13 21:25:00 msofer Exp $ */ #include "tclInt.h" diff --git a/S4-0-2/tclExecute.h b/S4-0-2/tclExecute.h index d646fa1..4a0a288 100644 --- a/S4-0-2/tclExecute.h +++ b/S4-0-2/tclExecute.h @@ -7,7 +7,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.h,v 1.1.2.1 2001/05/19 16:25:55 msofer Exp $ + * RCS: @(#) $Id: tclExecute.h,v 1.1.2.2 2001/07/13 21:25:00 msofer Exp $ */ diff --git a/S4-0-2/tclInt.h b/S4-0-2/tclInt.h index 9fed481..c6fe7ef 100644 --- a/S4-0-2/tclInt.h +++ b/S4-0-2/tclInt.h @@ -11,7 +11,9 @@ * 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.1.2.1 2001/05/19 16:25:55 msofer Exp $ + * Up-to-date with 1.57 + * + * RCS: @(#) $Id: tclInt.h,v 1.1.2.2 2001/07/13 21:25:00 msofer Exp $ */ #ifndef _TCLINT @@ -1609,6 +1611,9 @@ extern Tcl_ObjType tclIntType; extern Tcl_ObjType tclListType; extern Tcl_ObjType tclProcBodyType; extern Tcl_ObjType tclStringType; +extern Tcl_ObjType tclArraySearchType; +extern Tcl_ObjType tclIndexType; +extern Tcl_ObjType tclNsNameType; /* * Variables denoting the hash key types defined in the core. @@ -1849,6 +1854,7 @@ EXTERN int TclpMatchFiles _ANSI_ARGS_((Tcl_Interp *interp, EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, char *fileName, char *modeString, int permissions)); +EXTERN void TclpPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *, format)); EXTERN char * TclpReadlink _ANSI_ARGS_((CONST char *fileName, Tcl_DString *linkPtr)); EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr, @@ -2195,6 +2201,39 @@ EXTERN int TclCompileWhileCmd _ANSI_ARGS_((Tcl_Interp *interp, TclIncrObjsFreed(); \ } +#elif defined(PURIFY) + +/* + * The PURIFY mode is like the regular mode, but instead of doing block + * Tcl_Obj allocation and keeping a freed list for efficiency, it always + * allocates and frees a single Tcl_Obj so that tools like Purify can + * better track memory leaks + */ + + +# define TclNewObj(objPtr) \ +(objPtr) = (Tcl_Obj *) Tcl_Ckalloc(sizeof(Tcl_Obj)); \ +(objPtr)->refCount = 0; \ +(objPtr)->bytes = tclEmptyStringRep; \ +(objPtr)->length = 0; \ +(objPtr)->typePtr = NULL; \ +TclIncrObjsAllocated(); + + +# define TclDecrRefCount(objPtr) \ +if (--(objPtr)->refCount <= 0) { \ + if (((objPtr)->bytes != NULL) \ + && ((objPtr)->bytes != tclEmptyStringRep)) { \ + ckfree((char *) (objPtr)->bytes); \ + } \ + if (((objPtr)->typePtr != NULL) \ + && ((objPtr)->typePtr->freeIntRepProc != NULL)) { \ + (objPtr)->typePtr->freeIntRepProc(objPtr); \ + } \ + ckfree((char *) (objPtr)); \ + TclIncrObjsFreed(); \ +} + #else /* not TCL_MEM_DEBUG */ #ifdef TCL_THREADS diff --git a/generic/tclCompile.h b/generic/tclCompile.h index b36f727..acc82b8 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -7,7 +7,9 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.h,v 1.14.2.2 2001/05/19 16:12:18 msofer Exp $ + * Up-to-date with 1.15 + * + * RCS: @(#) $Id: tclCompile.h,v 1.14.2.3 2001/07/13 21:25:00 msofer Exp $ */ #ifndef _TCLCOMPILATION diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a0911bc..012eeba 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -17,7 +17,9 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.21.2.10 2001/07/13 17:03:46 msofer Exp $ + * Up-to-date with 1.25; missing the read-traces firing new in 1.26 + * + * RCS: @(#) $Id: tclExecute.c,v 1.21.2.11 2001/07/13 21:25:00 msofer Exp $ */ #include "tclInt.h" diff --git a/generic/tclInt.h b/generic/tclInt.h index df7a4c5..6a816d9 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -11,7 +11,9 @@ * 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.50.2.2 2001/05/19 16:12:18 msofer Exp $ + * Up-to-date with 1.57 + * + * RCS: @(#) $Id: tclInt.h,v 1.50.2.3 2001/07/13 21:25:00 msofer Exp $ */ #ifndef _TCLINT @@ -1609,6 +1611,9 @@ extern Tcl_ObjType tclIntType; extern Tcl_ObjType tclListType; extern Tcl_ObjType tclProcBodyType; extern Tcl_ObjType tclStringType; +extern Tcl_ObjType tclArraySearchType; +extern Tcl_ObjType tclIndexType; +extern Tcl_ObjType tclNsNameType; /* * Variables denoting the hash key types defined in the core. @@ -1849,6 +1854,7 @@ EXTERN int TclpMatchFiles _ANSI_ARGS_((Tcl_Interp *interp, EXTERN Tcl_Channel TclpOpenFileChannel _ANSI_ARGS_((Tcl_Interp *interp, char *fileName, char *modeString, int permissions)); +EXTERN void TclpPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *, format)); EXTERN char * TclpReadlink _ANSI_ARGS_((CONST char *fileName, Tcl_DString *linkPtr)); EXTERN char * TclpRealloc _ANSI_ARGS_((char *ptr, @@ -2195,6 +2201,39 @@ EXTERN int TclCompileWhileCmd _ANSI_ARGS_((Tcl_Interp *interp, TclIncrObjsFreed(); \ } +#elif defined(PURIFY) + +/* + * The PURIFY mode is like the regular mode, but instead of doing block + * Tcl_Obj allocation and keeping a freed list for efficiency, it always + * allocates and frees a single Tcl_Obj so that tools like Purify can + * better track memory leaks + */ + + +# define TclNewObj(objPtr) \ +(objPtr) = (Tcl_Obj *) Tcl_Ckalloc(sizeof(Tcl_Obj)); \ +(objPtr)->refCount = 0; \ +(objPtr)->bytes = tclEmptyStringRep; \ +(objPtr)->length = 0; \ +(objPtr)->typePtr = NULL; \ +TclIncrObjsAllocated(); + + +# define TclDecrRefCount(objPtr) \ +if (--(objPtr)->refCount <= 0) { \ + if (((objPtr)->bytes != NULL) \ + && ((objPtr)->bytes != tclEmptyStringRep)) { \ + ckfree((char *) (objPtr)->bytes); \ + } \ + if (((objPtr)->typePtr != NULL) \ + && ((objPtr)->typePtr->freeIntRepProc != NULL)) { \ + (objPtr)->typePtr->freeIntRepProc(objPtr); \ + } \ + ckfree((char *) (objPtr)); \ + TclIncrObjsFreed(); \ +} + #else /* not TCL_MEM_DEBUG */ #ifdef TCL_THREADS |