summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
Commit message (Collapse)AuthorAgeFilesLines
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-19/+19
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* * generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routinedgp2003-10-141-38/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | that appends a Tcl_Obj to the errorInfo, saving the caller the trouble of extracting the string rep. * generic/tclStringObj.c (TclAppendLimitedToObj): New internal routine that supports truncated appends with optional ellipsis marking. This single routine supports UTF-8-safe truncated appends needed in several places throughout the Tcl source code, mostly for error and stack messages. Clean fix for [Bug 760872]. * generic/tclInt.h: Declarations for new internal routines. * generic/tclCmdMZ.c: Updated callers to use the new routines. * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclProc.c: * generic/tclStringObj.c: * mac/tclMacResource.c: * library/init.tcl: Updated ::errorInfo cleanup in [unknown] to reflect slight modifications to Tcl_LogCommandInfo(). Corrects failing init-4.* tests.
* * win/makefile.vc: Applied patches for bug #801467 by Joe Mistachkinpatthoyts2003-10-091-1/+2
| | | | | * win/tclAppInit.c: to fix incompatible TCL_MEM_DEBUG handling in * generic/tclObj.c: Win32 VC builds.
* TIP#112 ([namespace ensemble] command) implementation.dkf2003-09-291-1/+2
|
* * generic/tcl.h: Revert change made on 2003-07-21mdejong2003-07-241-14/+109
| | | | | | | | | | | | | | | since it made the sizeof(Tcl_Obj) different for regular vs mem debug builds. * generic/tclInt.h: Define TclDecrRefCount in terms of Tcl_DbDecrRefCount which removes one layer of inderection. * generic/tclObj.c (TclDbInitNewObj, Tcl_DbIncrRefCount, Tcl_DbDecrRefCount, Tcl_DbIsShared): Define ThreadSpecificData that contains a hashtable. The table is used to ensure that a Tcl_Obj is only acted upon in the thread that allocated it. This checking code is enabled only when mem debug and threads are enabled.
* Check that the thread incrementing or decrementingmdejong2003-07-221-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the ref count of a Tcl_Obj is the thread that originally allocated the thread. This fail fast behavior will catch programming errors that allow a single Tcl_Obj to be accessed from multiple threads. * generic/tcl.h (Tcl_Obj): Add allocThread member to Tcl_Obj. This member records the thread id the Tcl_Obj was allocated. It is used to check that any future ref count incr or decr is done from the same thread that allocated the Tcl_Obj. This member is defined only when threads and mem debug are enabled. * generic/tclInt.h (TclNewObj, TclDbNewObj, TclDecrRefCount): Define TclNewObj and TclDbNewObj using TclDbInitNewObj when mem debug is enabled. This fixes a problem where TclNewObj calls did not work the same as TclDbNewObj when mem debug was enabled. * generic/tclObj.c (TclDbInitNewObj, Tcl_DbIncrRefCount, Tcl_DbDecrRefCount): Add new helper to init Tcl_Obj members when mem debug is enabled. Init the allocThread member in TclDbInitNewObj and check it in Tcl_DbIncrRefCount and Tcl_DbDecrRefCount to make sure a Tcl_Obj allocated in one thread is not being acted upon in another thread.
* * generic/tclObj.c (tclCmdNameType): Converted internal repdgp2003-05-231-8/+18
| | | | | | | | management of the cmdName Tcl_ObjType the opposite way, to always use the twoPtrValue instead of always using the otherValuePtr. Previous fix on 2003-05-12 broke several extensions that wanted to poke around with the twoPtrValue.ptr2 value of a cmdName Tcl_Obj, like TclBlend and e4graph. [Bug 726018]
* * generic/tclObj.c (tclCmdNameType): Corrected variable use of thedgp2003-05-121-7/+4
| | | | | otherValuePtr or the twoPtrValue.ptr1 fields to store a (ResolvedCmdName *) as the internal rep. [Bug 726018].
* * generic/tcl.h Made changes so that the "wideInt" Tcl_ObjTypedgp2003-04-161-25/+9
| | | | | | | | | | | | | | | | | | | | | | * generic/tclObj.c is defined on all platforms, even those where * generic/tclPort.h TCL_WIDE_INT_IS_LONG is defined. Also made the Tcl_Value struct have a wideValue field on all platforms. This is a ***POTENTIAL INCOMPATIBILITY*** for TCL_WIDE_INT_IS_LONG platforms because that struct changes size. This is the same TIP 72 incompatibility that was seen on other platforms at the 8.4.0 release, when this change should have happened as well. [Bug 713562] * generic/tclInt.h: New internal macros TclGetWide() and TclGetLongFromWide() to deal with both forms of the "wideInt" Tcl_ObjType, so that conditional TCL_WIDE_INT_IS_LONG code is confined to the header file. * generic/tclCmdAH.c: Replaced most coding that was conditional * generic/tclCmdIL.c: on TCL_WIDE_INT_IS_LONG with code that * generic/tclExecute.c: works across platforms, sometimes using * generic/tclTest.c: the new macros above to do it. * generic/tclUtil.c: * generic/tclVar.c:
* Fixed bugs 715751 and 713562 so dict code should build everywhere and wide intsdkf2003-04-071-6/+9
| | | | be defined (though not necessarily useful) everywhere.
* Final stage of getting dictionaries into the core. Test suite should work now!dkf2003-04-051-1/+2
|
* * generic/tcl.h: Revert earlier change thatmdejong2003-01-171-1/+7
| | | | | | | | | | | | defined TCL_WIDE_INT_TYPE as long long and TCL_LL_MODIFIER as L when compiling with mingw. This change ended up causing some test case failures when compiling with mingw. * generic/tclObj.c (UpdateStringOfWideInt): Describe the warning generated by mingw and why it needs to be ignored so that someone is not tempted to "fix" this problem again in the future.
* * generic/tclUtil.c (SetEndOffsetFromAny): handle integer offsethobbs2002-11-191-10/+14
| | | | | | | | | | after the "end-" prefix. * generic/get.test: * generic/string.test: * generic/tclObj.c (SetIntFromAny, SetWideIntFromAny): * generic/tclGet.c (TclGetLong, Tcl_GetInt): simplify sign handling before calling strtoul(l). [Bug #634856]
* 2002-08-23 Miguel Sofer <msofer@users.sourceforge.net>Miguel Sofer2002-08-241-4/+8
| | | | | * generic/tclObj.c (USE_THREAD_ALLOC): fixed leak [Bug 597936]. Thanks to Zoran Vasiljevic.
* * generic/tclInt.h:Miguel Sofer2002-08-141-37/+7
| | | | | | | | | * generic/tclObj.c: (code cleanup) factored the parts in the macros TclNewObj() / TclDecrRefCount() into a common part for all memory allocators and two new macros TclAllocObjStorage() / TclFreeObjStorage() that are specific to each allocator and fully describe the differences. Removed allocator-specific code from tclObj.c by using the macros.
* * docs/BoolObj.3: added description of valid string reps for aMiguel Sofer2002-08-071-97/+117
| | | | | | | boolean object [Bug 584794] * generic/tclObj.c: optimised Tcl_GetBooleanFromObj and SetBooleanFromAny to avoid parsing the string rep when it can be avoided [Bugs 584650, 472576]
* * generic/tclCompile.h:Miguel Sofer2002-08-071-2/+2
| | | | | * generic/tclObj.c: making tclCmdNameType static ([Bug 584567], Don Porter).
* * generic/tclObj.c (Tcl_NewObj): added conditional code forMiguel Sofer2002-08-071-1/+3
| | | | | USE_THREAD_ALLOC; objects allocated through Tcl_NewObj() were otherwise being leaked. [Bug 587488] reported by Sven Sass.
* * doc/CmdCmplt.3: Applied Patch 585105 to fully CONST-ifydgp2002-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/Concat.3: all remaining public interfaces of Tcl. * doc/CrtCommand.3: Notably, the parser no longer writes on * doc/CrtSlave.3: the string it is parsing, so it is no * doc/CrtTrace.3: longer necessary for Tcl_Eval() to be * doc/Eval.3: given a writable string. Also, the * doc/ExprLong.3: refactoring of the Tcl_*Var* routines * doc/LinkVar.3: by Miguel Sofer is included, so that the * doc/ParseCmd.3: "part1" argument for them no longer needs * doc/SetVar.3: to be writable either. * doc/TraceVar.3: * doc/UpVar.3: Compatibility support has been enhanced so * generic/tcl.decls that a #define of USE_NON_CONST will remove * generic/tcl.h all possible source incompatibilities with * generic/tclBasic.c the 8.3 version of the header file(s). * generic/tclCmdMZ.c The new #define of USE_COMPAT_CONST now does * generic/tclCompCmds.c what USE_NON_CONST used to do -- disable * generic/tclCompExpr.c only those new CONST's that introduce * generic/tclCompile.c irreconcilable incompatibilities. * generic/tclCompile.h * generic/tclDecls.h Several bugs are also fixed by this patch. * generic/tclEnv.c [Bugs 584051,580433] [Patches 585105,582429] * generic/tclEvent.c * generic/tclInt.decls * generic/tclInt.h * generic/tclIntDecls.h * generic/tclInterp.c * generic/tclLink.c * generic/tclObj.c * generic/tclParse.c * generic/tclParseExpr.c * generic/tclProc.c * generic/tclTest.c * generic/tclUtf.c * generic/tclUtil.c * generic/tclVar.c * mac/tclMacTest.c * tests/expr-old.test * tests/parseExpr.test * unix/tclUnixTest.c * unix/tclXtTest.c * win/tclWinTest.c
* bugfix, new tests for new [interp alias] codeMiguel Sofer2002-07-291-4/+3
|
* Hex values on 64-bit machines can be booleans too! [Bug 548686]dkf2002-04-261-3/+25
|
* reversed accidental commit of unfinished sourceshobbs2002-02-271-10/+21
|
* generic/tclCmdMZ.chobbs2002-02-271-21/+10
|
* * generic/tclInt.h:dgp2002-02-221-3/+3
| | | | | | | * generic/tclObj.c: renamed global variable emptyString -> tclEmptyString because it is no longer static. * generic/tclPkg.c: Fix for panic when library is loaded on a platform without backlinking without proper use of stubs. [Bug 476537]
* TIP#72 implementation. See ChangeLog for details.dkf2002-02-151-7/+417
| | | | | This version builds clean on Solaris/SPARC, with GCC and CC, both with and without threads and both in 32-bit and 64-bit mode.
* * [Patch 505630] Updated interfaces of generic/tclBasic.cc (TIP 27).dgp2002-01-251-2/+2
| | | | | | | * [Patch 506818] Updated interfaces of generic/tclHash.c (TIP 27). * [Patch 506807] Updated interfaces of generic/tclObj.c (TIP 27). * [Patch 507304] Updated interfaces of win/tclWin32.c (TIP 27). * Update all callers.
* * generic/tclCkalloc.c (MemoryCmd, TclFinalizeMemorySubsystem):dgp2001-12-281-10/+10
| | | | | | | | | | | | | | | | | | | Added the [memory onexit] command, intended to replace [checkmem]. * doc/DumpActiveMemory.3: * doc/memory.n: Updated documentation for [memory] and related matters. [Bug 487677] * mac/tclMacBOAMain.c (Tcl_Main, CheckmemCmd): Removed all the machinery for the [checkmem] command that is completely duplicated by code in generic/tclCkalloc.c. * generic/tclBinary.c: * generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Removed references to [checkmem] in comments, referencing [memory active] instead, since it is documented.
* ** upport to 8.4 of mac code changes for 8.3.3 & various newdas2001-11-231-1/+2
| | | | | | ** changes for 8.4, some already backported to 8.3.4 (patch #435658) see ChangeLog for details
* Moved Tcl_GetCommandFromObj and all defining code for tclCmdNameType objects ↵Miguel Sofer2001-11-161-1/+425
| | | | to tclObj.c
* Reference implementation of TIP's #22, #33 and #45. Adds thehobbs2001-11-141-1/+2
| | | | | | ability of the [lindex] command to have multiple index arguments, and adds the [lset] command. Both commands are byte-code compiled. [Patch #471874] (work by Kenny, commited by Hobbs)
* * generic/tclInt.h:hobbs2001-06-281-2/+13
| | | | | | | * generic/tclObj.c: * unix/Makefile.in: added a -DPURIFY mode that makes Tcl_Obj's allocated and free singularly (instead of in alloc in blocks and never free) to allow checkers like Purify to operate better.
* [Patch #424851]: Faster array searching & obj cleanupMiguel Sofer2001-05-261-1/+4
|
* * generic/tclObj.c (TclAllocateFreeObjects): simplifiedhobbs2001-05-231-40/+22
| | | | | | objSizePlusPadding to use sizeof(Tcl_Obj) (max) Corrected use of tclObjsAlloced/Freed/Shared in TCL_MEM_DEBUG compile.
* (TIP#27) Changed a number of Tcl API's to accept "CONST char*"Kevin B Kenny2001-04-041-12/+12
| | | | in place of simple "char*". (kennykb) [Patch #404026]
* 2000-01-18 Andreas Kupries <a.kupries@westend.com>andreas_kupries2001-01-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Everything below belongs together, it fixes bug #123153. * generic/tcl.h (line 342): A bit more explanation about the default value for TCL_PRESERVE_BINARY_COMPATABILITY. * generic/tcl.h (line 1208): Removed the macro 'Tcl_InitHashTable' as it kills binary compatibility to 8.3 and earlier versions. This is the main part of the patch/change. * generic/tcl.decls (line 1469): * generic/tclHash.c (Tcl_InitHashTable): * generic/tclHash.c (Tcl_InitHashTableEx): * generic/tclObj.c (Tcl_InitObjHashTable): Changed 'Tcl_InitHashTableEx' to 'Tcl_InitCustomHashTable'. This change is more of an estethical nature, replacing the ubiquitous 'Ex' suffix with a more meaningful name. The introduced binary incompatibility is deemed acceptable as it is between alpha versions. Updated callers. * doc/Hash.3: * unix/mkLinks: Changed 'Tcl_InitHashTableEx' to 'Tcl_InitCustomHashTable'.
* 2000-08-10 David Gravereaux <davygrvy@ajubasolutions.com>davidg2000-08-101-15/+15
| | | | | * generic/tclObj.c: r1.15 accidentally changed a global mutex name tclObjMutex to ObjMutex. Put the correct name back.
* * generic/tclStubInit.c:ericm2000-07-221-30/+260
| | | | | | | | | | | * generic/tclObj.c: * generic/tclInt.h: * generic/tclHash.c: * generic/tclDecls.h: * generic/tcl.h: * generic/tcl.decls: * doc/Hash.3: Reapplied patch from Paul Duffin to extend hash tables to allow custom key types, such as Tcl_Obj *'s, and others.
* * generic/tclStubInit.c:ericm2000-07-201-260/+30
| | | | | | | | | | | | * generic/tclObj.c: * generic/tclInt.h: * generic/tclHash.c: * generic/tclDecls.h: * generic/tcl.h: * generic/tcl.decls: * doc/Hash.3: Reverted patch from Paul Duffin to extend hash tables to allow custom key types, such as Tcl_Obj *'s, and others; it seems to break Tk.
* * generic/tclStubInit.c:ericm2000-07-191-30/+260
| | | | | | | | | | | * generic/tclObj.c: * generic/tclInt.h: * generic/tclHash.c: * generic/tclDecls.h: * generic/tcl.h: * generic/tcl.decls: * doc/Hash.3: Applied patch from Paul Duffin to extend hash tables to allow custom key types, such as Tcl_Obj *'s, and others.
* * generic/tclInt.h:hobbs2000-05-261-1/+19
| | | | | * generic/tclObj.c (Tcl_DbIsShared): added support for checking result of Tcl_IsShared in evalstats (TCL_COMPILE_STATS).
* * generic/tclObj.c (Tcl_DuplicateObj): simplified code to callhobbs2000-05-081-10/+2
| | | | TclInitStringRep, which the code was just duplicating in part.
* * tests/expr-old.test:hobbs1999-12-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/parseExpr.test: * tests/string.test: * generic/tclGet.c: * generic/tclInt.h: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclUtil.c: * generic/tclExecute.c: added TclCheckBadOctal routine to enhance error message checking for when users use invalid octal numbers (like 08), as well as replumbed the Expr*Funcs with a new VerifyExprObjType to simplify type handling. * tests/expr.test: * generic/tclCompile.c: fixed 'bad code length' error for 'expr + {[incr]}' case, with new test case [Bug: 3736] and seg fault on 'expr + {[error]}' (different cause) that was caused by a correct optimization that didn't correctly track how it was modifying the source string in the opt. The optimization was removed, which means that: expr 1 + {[string length abc]} will be not be compiled inline as before, but this should be written: expr {1 + [string length abc]} which will be compiled inline for speed. This prevents expr 1 + {[mindless error]} from seg faulting, and only affects optimizations for degenerate cases [Bug: 3737]
* * generic/tclIOUtil.c: changed Tcl_Alloc to ckallochobbs1999-11-101-28/+86
| | | | | | | | | * generic/tclInt.h: * generic/tclObj.c: rolled back changes from 1999-10-29 Purify noted new leaks with that code * generic/tclParse.c: added code in Tcl_ParseBraces to test for possible unbalanced open brace in a comment
* Cleanup of the TclNewObj family of macros, and elimination of thewelch1999-10-301-86/+28
| | | | | special Tcl_Obj memory allocator for the TCL_THREADS case, because this only adds lock contention.
* Merged String and Unicode object types. Added new functions tohershey1999-06-151-2/+1
| | | | | | | | | the puplic API: Tcl_NewUnicodeObj, Tcl_SetUnicodeObj, Tcl_GetUnicode, Tcl_GetUniChar, Tcl_GetCharLength, Tcl_GetRange, Tcl_AppendUnicodeToObj. Note: some stringObj tests are still failing--the teststringobj command still needs to be updated.
* * tests/string.test:hershey1999-06-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | * generic/tclVar.c (Tcl_SetVar2Ex): * generic/tclStringObj.c (Tcl_AppendObjToObj): * generic/tclCmdMZ.c (Tcl_StringObjCmd): optimized the string index, string length, string range, and append command in cases where the object's internal rep is a bytearray. Objects with other internal reps are converted to have the new unicode internal rep. * unix/Makefile.in: * win/Makefile.in: * win/Makefile.vc: * tests/unicode.test: * generic/tclInt.h: * generic/tclObj.c: * generic/tclUnicodeObj.c: added a new object type to store the unicode representation of a string. * generic/tclTestObj.c: added the objtype option to the testobj command. This option returns the name of the type of internal rep an object has.
* * generic/tclObj.c: Changed to eliminate use of isupper/tolower instanton1999-05-281-3/+3
| | | | favor of the Unicode versions.
* * mac/tclMacResource.c:stanton1999-04-281-5/+5
| | | | | | | | | * generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Changed to avoid freeing the string representation before freeing the internal rep. This helps with debugging since the string rep will still be valid when the free proc is invoked.
* merged tcl 8.1 branch back into the main trunkstanton1999-04-161-210/+155
|
* Merged stubs changes into mainline for 8.0stanton1999-03-101-1/+2
|