summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-09-29 22:17:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-09-29 22:17:28 (GMT)
commit1d5b0da0c8f65eeca48341adca32a96a8774f84a (patch)
tree9a574faca8ab395bddcb8ebbfcba24f070a7296a /generic/tclInt.h
parente63ee140f8bf8b9c127ad90c03a516be076d6ae1 (diff)
downloadtcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.zip
tcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.tar.gz
tcl-1d5b0da0c8f65eeca48341adca32a96a8774f84a.tar.bz2
Factorize out the code for freeing an object's internal rep.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h18
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.