diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2004-09-29 22:17:28 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2004-09-29 22:17:28 (GMT) |
| commit | 6cd42534eb8e9ab72ca598391f20a89ee91256c7 (patch) | |
| tree | 9a574faca8ab395bddcb8ebbfcba24f070a7296a /generic/tclInt.h | |
| parent | 5168f3edd958f497f7c6d23b5d6e0ddf377bf31f (diff) | |
| download | tcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.zip tcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.tar.gz tcl-6cd42534eb8e9ab72ca598391f20a89ee91256c7.tar.bz2 | |
Factorize out the code for freeing an object's internal rep.
Diffstat (limited to 'generic/tclInt.h')
| -rw-r--r-- | generic/tclInt.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 4c8c940..249c96e 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.175 2004/09/27 14:31:18 kennykb Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.176 2004/09/29 22:17:31 dkf Exp $ */ #ifndef _TCLINT @@ -2477,6 +2477,22 @@ EXTERN void TclDbInitNewObj _ANSI_ARGS_((Tcl_Obj *objPtr)); /* *---------------------------------------------------------------- + * Macro used by the Tcl core to clean out an object's internal + * representation. Does not actually reset the rep's bytes. + * The ANSI C "prototype" for this macro is: + * + * EXTERN void TclFreeIntRep _ANSI_ARGS_((Tcl_Obj *objPtr)); + *---------------------------------------------------------------- + */ + +#define TclFreeIntRep(objPtr) \ + if ((objPtr)->typePtr != NULL && \ + (objPtr)->typePtr->freeIntRepProc != NULL) { \ + (objPtr)->typePtr->freeIntRepProc(objPtr); \ + } + +/* + *---------------------------------------------------------------- * Macro used by the Tcl core to get a Tcl_WideInt value out of * a Tcl_Obj of the "wideInt" type. Different implementation on * different platforms depending whether TCL_WIDE_INT_IS_LONG. |
