diff options
author | dgp <dgp@noemail.net> | 2011-06-02 16:55:02 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-06-02 16:55:02 (GMT) |
commit | 7617c70883b97780bafa73646c5ba8c78ebcef85 (patch) | |
tree | 33c9cf357b23e927503b1c254d88451a1b56566d /generic/tclLiteral.c | |
parent | 010dd68b8ee68f98c66b155189a0e7b9de5cfdf6 (diff) | |
download | tcl-7617c70883b97780bafa73646c5ba8c78ebcef85.zip tcl-7617c70883b97780bafa73646c5ba8c78ebcef85.tar.gz tcl-7617c70883b97780bafa73646c5ba8c78ebcef85.tar.bz2 |
Remove TclCleanupLiteralTable (see 994838).
FossilOrigin-Name: d1c7844dd87d04d8ca50b311037a54cd93f49829
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r-- | generic/tclLiteral.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 62dc5c0..2c91b82 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( "literal without a string rep" ); - } - objPtr->typePtr = NULL; - typePtr->freeIntRepProc(objPtr); - didOne = 1; - break; - } else { - entryPtr = nextPtr; - } - } - } while (didOne); - } -} - -/* - *---------------------------------------------------------------------- - * * TclDeleteLiteralTable -- * * This function frees up everything associated with a literal table |