Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
|
|
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>
|
|
For performance reasons
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
The API function definition for Jim_InitStringRep() has been removed
by the commit:
commit 2e8b9ddb92ed1cea3054ed8180d363c9dcc72dd9
Author: Steve Bennett <steveb@workware.net.au>
Date: Sat Feb 18 14:47:11 2012 +1000
Small cleanup/optimisation in object create/dup
Remove the declaration from the headers as well.
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
|
|
No perf difference measured using bench.tcl.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
|
|
Ensure that the internal rep of interp->emptyObj is never
changed to a script, since scripts use emptyObj as the source
filename when no source info is available. Instead use a special
nullScriptObj for this purpose.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
See README.namespaces
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
It does not extend well enough to the general case,
so remove it for simplicity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Also adds Jim_ListGetIndex(), like Jim_ListIndex() but with a more convenient interface
|
|
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>
|
|
The core of [join]
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Faster on 32 bit systems, and 64 bits is overkill here.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
These are very common operations.
Creating versions separate from Jim_GetString() saves size and speed.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Invokes a callback to add elements with keys matching a pattern to a list
Use for info subcommands: commands, procs, channels, globals, locals, vars
Also: dict keys, array get
Also avoid some dict/list conversions
And simplify the implementation of array set
|
|
Remove const-ness of hash table keys
Also consolidate string hashtable ops
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Mainly avoid double hash calculation and lookup
in the case where an entry is to be replaced.
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>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Jim_EvalObjPrefix now accepts an arbitrary Jim_Obj as a prefix,
with Jim_EvalPrefix being equivalent to the older version.
|
|
Although [dict unset] should not complain about
being unable to unset a missing element, unset via array
syntax (dict sugar) should - to be compatible with Tcl.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Since the line number should correspond to the first
line of the script, it is easier to use with __LINE__
if the filename and line number are before the script.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Remove the old shared-string implementation.
The new approach reuses the Jim_Obj reference counting
so it is smaller and a little more straight forward.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Allows args and optional parameters in any location,
in addition to being smaller and faster.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Instead do it properly with a union
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Enables [debug] and JimPanic()
JimPanic() is an assertion feature which is generally
only of interest to developers, so disable it by default
to save space and time.
|
|
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>
|
|
Shared libraries can't access environ directly, so use
_NSGetEnviron() on Mac OS X
Also, load modules with (RTLD_NOW | RTLD_LOCAL) instead of RTLD_LAZY
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Faster, simpler auto-configuration
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Allows previous command definitions to be invoked when
otherwise hidden via [local]
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
There is no overlap between proc command fields and native
command fields, so overlap them with a union.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
It is very common to get the string value
without the length. Jim_String() is a macro which does that.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
In general, use Jim_ only for public APIs.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Store the level directly in the call frame rather
than counting it separately.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|