summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-06-02 16:58:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-06-02 16:58:46 (GMT)
commit877e07444a016659d8dbbe96478f44c4f56aa40f (patch)
tree33e38da0d7f16d0461aae2005d20126a6c7482ff
parentd8a99b464be44ee36d293c2d2aed4e0e502a23b3 (diff)
parent2b5168b50a2657829ffc6687f1f13f87acb053ce (diff)
downloadtcl-877e07444a016659d8dbbe96478f44c4f56aa40f.zip
tcl-877e07444a016659d8dbbe96478f44c4f56aa40f.tar.gz
tcl-877e07444a016659d8dbbe96478f44c4f56aa40f.tar.bz2
Remove TclCleanupLiteralTable (see 994838).
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclBasic.c1
-rw-r--r--generic/tclInt.h2
-rw-r--r--generic/tclLiteral.c71
4 files changed, 6 insertions, 74 deletions
diff --git a/ChangeLog b/ChangeLog
index fc7865a..b8f05ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-02 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclBasic.c: Removed TclCleanupLiteralTable(), and old
+ * generic/tclInt.h: band-aid routine put in place while a fix
+ * generic/tclLiteral.c: for [Bug 994838] took shape. No longer needed.
+
2011-06-02 Donal K. Fellows <dkf@users.sf.net>
* generic/tclInt.h (TclInvalidateNsCmdLookup): [Bug 3185407]: Extend
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index f4e026f..6791cbf 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1428,7 +1428,6 @@ DeleteInterpProc(
* table, as it will be freed later in this function without further use.
*/
- TclCleanupLiteralTable(interp, &iPtr->literalTable);
TclHandleFree(iPtr->handle);
TclTeardownNamespace(iPtr->globalNsPtr);
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 398d64c..ebc8bef 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2893,8 +2893,6 @@ MODULE_SCOPE int TclChanCaughtErrorBypass(Tcl_Interp *interp,
MODULE_SCOPE Tcl_ObjCmdProc TclChannelNamesCmd;
MODULE_SCOPE int TclClearRootEnsemble(ClientData data[],
Tcl_Interp *interp, int result);
-MODULE_SCOPE void TclCleanupLiteralTable(Tcl_Interp *interp,
- LiteralTable *tablePtr);
MODULE_SCOPE ContLineLoc *TclContinuationsEnter(Tcl_Obj *objPtr, int num,
int *loc);
MODULE_SCOPE void TclContinuationsEnterDerived(Tcl_Obj *objPtr,
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 72c4577..3a9f8e1 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -75,77 +75,6 @@ TclInitLiteralTable(
/*
*----------------------------------------------------------------------
*
- * TclCleanupLiteralTable --
- *
- * This function frees the internal representation of every literal in a
- * literal table. It is called prior to deleting an interp, so that
- * variable refs will be cleaned up properly.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Each literal in the table has its internal representation freed.
- *
- *----------------------------------------------------------------------
- */
-
-void
-TclCleanupLiteralTable(
- Tcl_Interp *interp, /* Interpreter containing literals to purge */
- LiteralTable *tablePtr) /* Points to the literal table being
- * cleaned. */
-{
- int i;
- LiteralEntry *entryPtr; /* Pointer to the current entry in the hash
- * table of literals. */
- LiteralEntry *nextPtr; /* Pointer to the next entry in the bucket. */
- Tcl_Obj *objPtr; /* Pointer to a literal object whose internal
- * rep is being freed. */
- const Tcl_ObjType *typePtr; /* Pointer to the object's type. */
- int didOne; /* Flag for whether we've removed a literal in
- * the current bucket. */
-
-#ifdef TCL_COMPILE_DEBUG
- TclVerifyGlobalLiteralTable((Interp *) interp);
-#endif /* TCL_COMPILE_DEBUG */
-
- for (i=0 ; i<tablePtr->numBuckets ; i++) {
- /*
- * It is tempting simply to walk each hash bucket once and delete the
- * internal representations of each literal in turn. It's also wrong.
- * The problem is that freeing a literal's internal representation can
- * delete other literals to which it refers, making nextPtr invalid.
- * So each time we free an internal rep, we start its bucket over
- * again.
- */
-
- do {
- didOne = 0;
- entryPtr = tablePtr->buckets[i];
- while (entryPtr != NULL) {
- objPtr = entryPtr->objPtr;
- nextPtr = entryPtr->nextPtr;
- typePtr = objPtr->typePtr;
- if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
- if (objPtr->bytes == NULL) {
- Tcl_Panic("%s: literal without a string rep",
- "TclCleanupLiteralTable");
- }
- objPtr->typePtr = NULL;
- typePtr->freeIntRepProc(objPtr);
- didOne = 1;
- break;
- }
- entryPtr = nextPtr;
- }
- } while (didOne);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
* TclDeleteLiteralTable --
*
* This function frees up everything associated with a literal table