summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2011-03-21 11:42:46 (GMT)
committermig <mig>2011-03-21 11:42:46 (GMT)
commit23e778541ae5ff3bf0ef8b74c37bcd13b8f8ef94 (patch)
tree667c30e00415025fb68e6b42273de7b192000471
parent060fd2cde91e18a0c1277d336f092cb708b48659 (diff)
downloadtcl-23e778541ae5ff3bf0ef8b74c37bcd13b8f8ef94.zip
tcl-23e778541ae5ff3bf0ef8b74c37bcd13b8f8ef94.tar.gz
tcl-23e778541ae5ff3bf0ef8b74c37bcd13b8f8ef94.tar.bz2
some cleanup re obj deletion
-rw-r--r--generic/tclInt.decls6
-rw-r--r--generic/tclInt.h7
-rw-r--r--generic/tclIntDecls.h8
-rw-r--r--generic/tclObj.c32
-rw-r--r--generic/tclStubInit.c2
5 files changed, 12 insertions, 43 deletions
diff --git a/generic/tclInt.decls b/generic/tclInt.decls
index 75cb20a..4da999e 100644
--- a/generic/tclInt.decls
+++ b/generic/tclInt.decls
@@ -891,9 +891,9 @@ declare 225 {
Tcl_Obj *TclTraceDictPath(Tcl_Interp *interp, Tcl_Obj *rootPtr,
int keyc, Tcl_Obj *const keyv[], int flags)
}
-declare 226 {
- int TclObjBeingDeleted(Tcl_Obj *objPtr)
-}
+#declare 226 {
+# int TclObjBeingDeleted(Tcl_Obj *objPtr)
+#}
declare 227 {
void TclSetNsPath(Namespace *nsPtr, int pathLength,
Tcl_Namespace *pathAry[])
diff --git a/generic/tclInt.h b/generic/tclInt.h
index a05007f..911cea6 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2668,13 +2668,6 @@ MODULE_SCOPE const Tcl_HashKeyType tclOneWordHashKeyType;
MODULE_SCOPE const Tcl_HashKeyType tclStringHashKeyType;
MODULE_SCOPE const Tcl_HashKeyType tclObjHashKeyType;
-/*
- * The head of the list of free Tcl objects, and the total number of Tcl
- * objects ever allocated and freed.
- */
-
-MODULE_SCOPE Tcl_Obj * tclFreeObjList;
-
#ifdef TCL_COMPILE_STATS
MODULE_SCOPE long tclObjsAlloced;
MODULE_SCOPE long tclObjsFreed;
diff --git a/generic/tclIntDecls.h b/generic/tclIntDecls.h
index dce5dae..0e9d54f 100644
--- a/generic/tclIntDecls.h
+++ b/generic/tclIntDecls.h
@@ -522,8 +522,7 @@ EXTERN TclPlatformType * TclGetPlatform(void);
EXTERN Tcl_Obj * TclTraceDictPath(Tcl_Interp *interp,
Tcl_Obj *rootPtr, int keyc,
Tcl_Obj *const keyv[], int flags);
-/* 226 */
-EXTERN int TclObjBeingDeleted(Tcl_Obj *objPtr);
+/* Slot 226 is reserved */
/* 227 */
EXTERN void TclSetNsPath(Namespace *nsPtr, int pathLength,
Tcl_Namespace *pathAry[]);
@@ -826,7 +825,7 @@ typedef struct TclIntStubs {
void (*reserved223)(void);
TclPlatformType * (*tclGetPlatform) (void); /* 224 */
Tcl_Obj * (*tclTraceDictPath) (Tcl_Interp *interp, Tcl_Obj *rootPtr, int keyc, Tcl_Obj *const keyv[], int flags); /* 225 */
- int (*tclObjBeingDeleted) (Tcl_Obj *objPtr); /* 226 */
+ void (*reserved226)(void);
void (*tclSetNsPath) (Namespace *nsPtr, int pathLength, Tcl_Namespace *pathAry[]); /* 227 */
void (*reserved228)(void);
int (*tclPtrMakeUpvar) (Tcl_Interp *interp, Var *otherP1Ptr, const char *myName, int myFlags, int index); /* 229 */
@@ -1221,8 +1220,7 @@ extern const TclIntStubs *tclIntStubsPtr;
(tclIntStubsPtr->tclGetPlatform) /* 224 */
#define TclTraceDictPath \
(tclIntStubsPtr->tclTraceDictPath) /* 225 */
-#define TclObjBeingDeleted \
- (tclIntStubsPtr->tclObjBeingDeleted) /* 226 */
+/* Slot 226 is reserved */
#define TclSetNsPath \
(tclIntStubsPtr->tclSetNsPath) /* 227 */
/* Slot 228 is reserved */
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 5ee957d..4298f62 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -26,6 +26,10 @@ static Tcl_HashTable typeTable;
static int typeTableInitialized = 0; /* 0 means not yet initialized. */
TCL_DECLARE_MUTEX(tableMutex)
+#if defined(TCL_THREADS) && defined(TCL_COMPILE_STATS)
+static Tcl_Mutex tclObjMutex;
+#endif
+
/*
* Pointer to a heap-allocated string of length zero that the Tcl core uses as
* the value of an empty string representation for an object. This value is
@@ -459,7 +463,7 @@ TclFinalizeThreadObjects(void)
* TclFinalizeObjects --
*
* This function is called by Tcl_Finalize to clean up all registered
- * Tcl_ObjType's
+ * Tcl_ObjType's and to reset the tclFreeObjList.
*
* Results:
* None.
@@ -1258,7 +1262,6 @@ TclFreeObj(
*/
TclInvalidateStringRep(objPtr);
- objPtr->length = -1;
if (ObjDeletePending(context)) {
PushObjToDelete(context, objPtr);
@@ -1408,31 +1411,6 @@ TclFreeObj(
/*
*----------------------------------------------------------------------
*
- * TclObjBeingDeleted --
- *
- * This function returns 1 when the Tcl_Obj is being deleted. It is
- * provided for the rare cases where the reason for the loss of an
- * internal rep might be relevant. [FR 1512138]
- *
- * Results:
- * 1 if being deleted, 0 otherwise.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclObjBeingDeleted(
- Tcl_Obj *objPtr)
-{
- return (objPtr->length == -1);
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_DuplicateObj --
*
* Create and return a new object that is a duplicate of the argument
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 0583961..dcf6005 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -280,7 +280,7 @@ static const TclIntStubs tclIntStubs = {
0, /* 223 */
TclGetPlatform, /* 224 */
TclTraceDictPath, /* 225 */
- TclObjBeingDeleted, /* 226 */
+ 0, /* 226 */
TclSetNsPath, /* 227 */
0, /* 228 */
TclPtrMakeUpvar, /* 229 */