Age | Commit message (Collapse) | Author | Files | Lines |
|
Commit 87ea45c91e removed the code to free cached callframes
when the interpreter is freed. Restore that code.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Sweep through and clean up all (most) of the comments in the code.
While there, adjust some variable and function names to be more consistent,
and make a few small code changes - again, mostly for consistency.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Only do fast dict->list conversion if there is no string rep
When converting list->dict, generate the string rep of a shared list to avoid
loss of info when converting to dict.
Also add a relevent test to dict.test
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And clean up expr parsing slightly
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
And use it from the expr evaluator
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Less manual handling of reference counts means less chance of
error and less code.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
If both a val dup and a val destructor exist, need to
dup before destroying.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Probably only developers care about reference count mismatches
at exit.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Instead of an explicit call in jim.c, store load
handles as AssocData so that it is automatically cleaned up.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This reverts commit 5155f363872af642ade631396d1d7303285c3481.
It seems that this change has made dict element addition slower,
so revert it.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Resolve the tailcall command immediately in [tailcall] and stash it.
If a tailcall is currently being evaluated, new tailcalls in the same
frame are merged/deferred to evaluate in the same C stack frame.
Can't merge tailcall evaluations across uplevel.
Add some tests for these cases
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Tabs accidentally crept into source files in violaton of the style guide
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Currently if an error is caught with catch { }, the location
of the error overrides the location of the next error that occurs.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Use isinf() and isnan() when converting double to string
to ensure that the value is given canonical form.
And implement our own isinf and isnan if necessary
|
|
dict for, values, incr, append, lappend, update, replace and info
Also implement array stat (the same as dict info)
Note that [dict info] and [array stat] are for useful for checking
the behaviour of the hash randomiser
Add Jim_EvalEnsemble()
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Set dup and free operations to automatically manage reference counting
of dictionary keys and values.
Replace Jim_ReplaceHashEntry() with JimDictReplaceHashEntry()
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
To avoid hash table collision attacks (n.runs-SA-2011.004)
Note that this options is *off* by default, but it is reasonable
to consider reversing this.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Currently tailcall resolves the command in the parent
namespace.
This also fixes the deletion of [local] commands
such that they are always correctly deleted.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
aio [open], as well as similar commands return the name of the
created command. If this is done in the non-global namespace, the
returned name is implicitly scoped to the current namespace while
the actual command is created in the global namespace. Thus [close]
does not work when invoked in that namespace.
The solution is to return a fully qualified name, such as ::aio.handle3
Note that this may also be a problem for similar command such as
[proc] and [alias] that return command names.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Andy <jimdevel@hummypkg.org.uk>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
From the interactive prompt.
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Andy <jimdevel@hummypkg.org.uk>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reported-by: Paul Fertser <fercerpav@gmail.com>
|
|
|
|
And remove declarations of some obsolete functions
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Prefer Jim_String() and Jim_Length() over Jim_GetString() where it makes sense.
Use Jim_ListGetIndex() where success is guaranteed.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Compile time option, for maintainer debugging
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
If the number started with an invalid prefix, e.g. "0x + 1",
number parsing would begin past the end of the string.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For performance reasons
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
The following should break when a handled signal is caught.
catch -signal { vwait forever }
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Can't just use abs()
This is the correct fix rather than c7e5c48
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Small time and space improvements
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Even though it shouldn't need to, sprintf uses the libc-internal mutex,
locale support, and other parts making it slow.
[while] busy loop - 306 ms 311 ms -
[for] busy loop - 180 ms 182 ms -
mini loops - 146 ms 146 ms -
fibonacci(25) - 191 ms 176 ms 92.1466
heapsort - 138 ms 131 ms 94.9275
sieve - 182 ms 143 ms 78.5714
sieve [dict] - 162 ms 138 ms 85.1852
ary - 188 ms 166 ms 88.2979
ary [dict] - 173 ms 156 ms 90.1734
repeat - 132 ms 130 ms -
upvar - 142 ms 147 ms -
nested loops - 173 ms 173 ms -
rotate - 22 ms 22 ms -
dynamic code - 108 ms 97 ms 89.8148
dynamic code (list) - 45 ms 46 ms -
PI digits - 333 ms 319 ms 95.7958
expand - 46 ms 45 ms -
wiki.tcl.tk/8566 - 251 ms 235 ms 93.6255
mandel - 212 ms 199 ms 93.8679
Signed-off-by: Lauri Kasanen <cand@gmx.com>
|
|
Only two bits are needed, so also change to unsigned char from int.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
|
|
It's more overhead than usable space to get space for two pointers.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
|