summaryrefslogtreecommitdiffstats
path: root/generic
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclBasic.c: fixed "leaks" in aliases, imports andMiguel Sofer2009-03-214-5/+15
| | | | | | | * generic/tclInt.h: ensembles. Only remaining known leak * generic/tclInterp.c: is in ensemble unknown dispatch (as it * generic/tclNamesp.c: not NR-enabled) * tests/tailcall.test:
* * tclInt.h: commentsMiguel Sofer2009-03-211-4/+2
| | | | | | * tests/tailcall.test: added tests to show that [tailcall] does not currently always execute in constant space: interp-alias, ns-imports and ensembles "leak" as of this commit.
* * generic/tclBasic.c: Fix for (among others) [Bug 2699087]Miguel Sofer2009-03-214-31/+78
| | | | | | | | | * generic/tclCmdAH.c: Tailcalls now perform properly even from * generic/tclExecute.c: within [eval]ed scripts. * generic/tclInt.h: More tests missing, as well as proper exploration and testing of the interaction with "redirectors" like interp-alias (suspect that it does not happen in constant space) and pure-eval commands.
* * generic/tclExecute.c: proper fix for [Bug 2415422]. ReenabledMiguel Sofer2009-03-211-8/+11
| | | | | | * tests/nre.test: the failing assertion that was disabled on 2008-12-18: the assertion is correct, the fault was in the management of expansions.
* * generic/tclExecute.c: fix both test and code for tailcallMiguel Sofer2009-03-211-1/+9
| | | | * tests/tailcall.test: from within a compiled [eval] body.
* * generic/tclExecute.c (INST_CONCAT1): Panic when appends overflowdgp2009-03-201-5/+17
| | | | the max length of a Tcl value. [Bug 2669109]
* * generic/tcl.h:Miguel Sofer2009-03-195-194/+136
| | | | | | | | | | | | | | * generic/tclInt.h: * generic/tclBasic.c: * generic/tclExecute.c: * generic/tclNamesp.c (Tcl_PopCallFrame): Rewritten tailcall implementation, ::unsupported::atProcExit is (temporarily?) gone. The new approach is much simpler, and also closer to being correct. This commit fixes [Bug 2649975] and [Bug 2695587]. * tests/coroutine.test: Moved the tests to their own files, * tests/tailcall.test: removed the unsupported.test. Added * tests/unsupported.test: tests for the fixed bugs.
* * generic/tclVar.c (TclLookupSimpleVar): Shift all calls todgp2009-03-181-7/+2
| | | | | | Tcl_SetErrorCode() out of TclLookupSimpleVar and onto its callers, where control with TCL_LEAVE_ERR_MSG flag is more easily handled. [Bug 2689307]
* Fix [Bug 2688063]dkf2009-03-161-27/+34
|
* revise fix for [Bug 2687952]Joe Mistachkin2009-03-162-7/+4
|
* Fix [Bug 2687952]dkf2009-03-152-5/+20
|
* Added support for SIGINFO. [Patch 1513655]dkf2009-03-151-1/+7
|
* * generic/tclBasic.c (TclNRCoroutineObjCmd): fix Tcl_Obj leak.Miguel Sofer2009-03-111-2/+1
| | | | Diagnose and fix thx to GPS.
* Move the implementation of [try] from Tcl to C. Not yet bytecoded.dkf2009-03-093-8/+504
|
* Related correctionsdkf2009-03-041-4/+4
|
* Fix bug 2662434dkf2009-03-041-3/+5
|
* [Bug 218977] Tcl_DbCkfree needs a return valuenijtmans2009-02-277-45/+41
| | | | don't use CONST84/CONST86 in internal header files
* * generic/tclUtil.c (TclStringMatchObj): Revised the branchingdgp2009-02-251-3/+4
| | | | | | | on the strObj->typePtr so that untyped values get converted to the "string" type and pass through the Unicode matcher. [Bug 2613766] Also added checks to only perform "bytearray" optimization on pure bytearray values. [Bug 2637173].
* * generic/tclCmdMZ.c: Since Tcl_GetCharLength() has its owndgp2009-02-252-27/+10
| | | | | * generic/tclExecute.c: optimizations for the tclByteArrayType, stop having the callers do them.
* * generic/tclStringObj.c: Several revisions to the shimmeringdgp2009-02-221-17/+65
| | | | | | | | | | | | | patterns between Unicode and UTF string reps. Most notably the call: objPtr = Tcl_NewUnicodeObj(...,0); followed by a loop of calls: Tcl_AppendUnicodeToObj(objPtr, u, n); will now grow and append to the Unicode representation. Before this commit, the sequence would convert each append to UTF and perform the append to the UTF rep. This is puzzling and likely a bug. The performance of [string map] is significantly improved by this change (according to the MAP collection of benchmarks in tclbench). Just in case there was some wisdom in the old ways that I missed, I left in the ability to restore the old patterns with a #define COMPAT 1 at the top of the file.
* * generic/tclPathObj.c: Fixed mistaken logic in TclFSGetPathType()dgp2009-02-201-1/+10
| | | | | | * tests/fileName.test: that assumed (not "absolute" => "relative"). This is a false assumption on Windows, where "volumerelative" is another possibility. [Bug 2571597].
* alternative solution to the signed/unsigned warningsdgp2009-02-191-5/+5
|
* fix signed/unsigned comparison warningsdas2009-02-191-4/+4
|
* * generic/tclStringObj.c: Simplify the logic of thedgp2009-02-181-66/+31
| | | | Tcl_*SetObjLength() routines.
* another TODOdgp2009-02-181-1/+2
|
* * generic/tclStringObj.c: Rewrite GrowStringBuffer() so that itdgp2009-02-181-16/+23
| | | | | | | | has parallel structure with GrowUnicodeBuffer(). The revision permits allocation attempts to continue all the way up to failure, with no gap. It also directly manipulates the String and Tcl_Obj internals instead of inefficiently operating via Tcl_*SetObjLength() with all of its extra protections and underdocumented special cases.
* * generic/tclStringObj.c: Another round of simplification ondgp2009-02-181-21/+21
| | | | the allocation macros.
* * generic/tclStringObj.c: Another round of simplification ondgp2009-02-181-29/+25
| | | | the allocation macros.
* * generic/tclStringObj.c: Pare back the length of the unicodedgp2009-02-171-12/+10
| | | | | | | | array in a non-extended String struct to one Tcl_UniChar, meant to hold the terminating NUL character. Non-empty unicode strings are then stored by extending the String struct by stringPtr->maxChars additional slots in that array with sizeof(Tcl_UniChar) bytes per slot. This revision makes the allocation macros much simpler.
* * generic/tclStringObj.c: Factor out common GrowUnicodeBuffer()dgp2009-02-171-44/+51
| | | | and solve overflow and growth algorithm fallbacks in it.
* * generic/tclStringObj.c: Factor out common GrowStringBuffer().dgp2009-02-171-150/+47
| | | | | | | | | | | * generic/tclStringObj.c: Convert Tcl_AppendStringsToObj into * tests/stringObj.test: a radically simpler implementation where we just loop over calls to Tcl_AppendToObj. This fixes [Bug 2597185]. It also creates a *** POTENTIAL INCOMPATIBILITY *** in that T_ASTO can now allocate more space than is strictly required, like all the other Tcl_Append* routines. The incompatibility was detected by test stringObj-6.5, which I've updated to reflect the new behavior.
* * generic/tclStringObj.c: Revise buffer growth implementationdgp2009-02-171-13/+32
| | | | | | | in ExtendStringRepWithUnicode. Use cheap checks to determine that no reallocation is necessary without cost of computing the precise number of bytes needed. Also make use of the string growth algortihm in the case of repeated appends.
* fix [Feature Request 2605263] use officialnijtmans2009-02-161-30/+82
| | | | zlib build.
* * generic/tclTestObj.c: Replace the [teststringobj ualloc] testingdgp2009-02-161-5/+5
| | | | | * tests/stringObj.test: command with [teststringobj maxchars] and update the tests.
* * generic/tclStringObj.c: Added protections from invalid memorydgp2009-02-162-6/+98
| | | | | | | * generic/tclTestObj.c: accesses when we append (some part of) * tests/stringObj.test: a Tcl_Obj to itself. Added the appendself and appendself2 subcommands to the [teststringobj] testing command and added tests to the test suite. [Bug 2603158]
* * generic/tclStringObj.c: Factor out duplicate code fromdgp2009-02-151-12/+4
| | | | Tcl_AppendObjToObj.
* * generic/tclStringObj.c: Replace the 'size_t uallocated' fielddgp2009-02-151-46/+42
| | | | | | | | of the String struct, storing the number of bytes allocated to store the Tcl_UniChar array, with an 'int maxChars' field, storing the number of Tcl_UniChars that may be stored in the allocated space. This reduces memory requirement a small bit, and makes some range checks simpler to code.
* * generic/tclStringObj.c: Removed limitation indgp2009-02-151-12/+7
| | | | | | | | Tcl_AppendObjToObj where the char length of the result was only computed if the appended string was all single byte characters. This limitation was in place to dodge a bug in Tcl_GetUniChar. With that bug gone, we can take advantage of always recording the length of append results when we know it.
* * generic/tclStringObj.c: Revisions so that we avoid creatingdgp2009-02-141-51/+73
| | | | | | | | | | | | the strange representation of an empty string with objPtr->bytes == NULL and stringPtr->hasUnicode == 0. Instead in the situations where that was being created, create a traditional two-legged stork representation (objPtr->bytes = tclEmptyStringRep and stringPtr->hasUnicode = 1). In the situations where the strange rep was treated differently, continue to do so by testing stringPtr->numChars == 0 to detect it. These changes make the code more conventional so easier for new maintainers to pick up. Also sets up further simplifications.
* * generic/tclTestObj.c: Revise updates to [teststringobj] so we don'tdgp2009-02-141-7/+5
| | | | get blocked by MODULE_SCOPE limits.
* Const correctness fixes in the debug build.dgp2009-02-141-5/+5
|
* Remove all "register" keywords.dgp2009-02-131-20/+20
|
* New utility routine UnicodeLength(), to compute the length of unicodedgp2009-02-131-23/+21
| | | | | buffer arguments when no length is passed in, with built-in overflow protection included. Update three callers to use it.
* * generic/tclStringObj.c: Rewrites of the routinesdgp2009-02-132-153/+124
| | | | | | | | | | | Tcl_GetCharLength, Tcl_GetUniChar, Tcl_GetUnicodeFromObj, Tcl_GetRange, and TclStringObjReverse to use the new macro, and to more simply and clearly split the cases depending on whether a valid unicode rep is present or needs to be created. * generic/tclInt.h: New macro TclNumUtfChars meant to be a faster replacement for a full Tcl_NumUtfChars() call when the string has all single-byte characters.
* * generic/tclStringObj.c: Simplified Tcl_GetCharLength bydgp2009-02-122-25/+32
| | | | | | * generic/tclTestObj.c: removing code that did nothing. Added early returns from Tcl_*SetObjLength when the desired length is already present; adapted test command to the change.
* * generic/tclStringObj.c: Re-implemented AppendUtfToUnicodeRepdgp2009-02-121-32/+49
| | | | | | so that we no longer pass through Tcl_DStrings which have their own sets of problems when lengths overflow the int range. Now AUTUR and FillUnicodeRep share a common core routine.
* Fix tricky point that meant it was next to impossible to extend [oo::define].dkf2009-02-121-4/+4
|
* Revise latest commit to better maintain stringPtr->numChars.dgp2009-02-121-8/+12
|
* * generic/tclStringObj.c: Re-implemented AppendUnicodeToUtfRepdgp2009-02-121-54/+79
| | | | | | so that we no longer pass through Tcl_DStrings which have their own sets of problems when lengths overflow the int range. Now AUTUR and UpdateStringOfString share a common core routine.
* Removed casts now unnecessary after type of stringPtr->allocated changed.dgp2009-02-111-5/+5
|