summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-06-02 14:55:53 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-06-02 14:55:53 (GMT)
commitd8a99b464be44ee36d293c2d2aed4e0e502a23b3 (patch)
tree8cec4f70262ff9a85d0a6d6120dafc75d8d0a36b
parent0bd52c5044d5dc3e8e67ce0af9e97358e6f5107e (diff)
parentc64a4321a3facb02fef01af7f7384f8ef961ff4f (diff)
downloadtcl-d8a99b464be44ee36d293c2d2aed4e0e502a23b3.zip
tcl-d8a99b464be44ee36d293c2d2aed4e0e502a23b3.tar.gz
tcl-d8a99b464be44ee36d293c2d2aed4e0e502a23b3.tar.bz2
[Bug 3185407]: Extend the set of epochs that are potentially bumped (in
TclInvalidateNsCmdLookup) when a command is created, for a slight performance drop (in some circumstances) and improved semantics.
-rw-r--r--ChangeLog17
-rw-r--r--generic/tclInt.h11
-rw-r--r--tests/namespace.test16
3 files changed, 35 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 8291a08..fc7865a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,18 +1,25 @@
+2011-06-02 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tclInt.h (TclInvalidateNsCmdLookup): [Bug 3185407]: Extend
+ the set of epochs that are potentially bumped when a command is
+ created, for a slight performance drop (in some circumstances) and
+ improved semantics.
+
2011-06-01 Miguel Sofer <msofer@users.sf.net>
- * generic/tclBasic.c: using the two free data elements in
- NRCommand to store objc and objv - useful for debugging.
+ * generic/tclBasic.c: Using the two free data elements in NRCommand to
+ store objc and objv - useful for debugging.
2011-06-01 Jan Nijtmans <nijtmans@users.sf.net>
- * generic/tclUtil.c: fix for [Bug 3309871]: Valgrind finds:
+ * generic/tclUtil.c: Fix for [Bug 3309871]: Valgrind finds:
invalid read in TclMaxListLength()
2011-05-31 Don Porter <dgp@users.sourceforge.net>
* generic/tclInt.h: Use a complete growth algorithm for lists
- * generic/tclListObj.c: so that length limits do not overconstrain
- * generic/tclStringObj.c: by a factor of 2. [Bug 3293874]
+ * generic/tclListObj.c: so that length limits do not overconstrain
+ * generic/tclStringObj.c: by a factor of 2. [Bug 3293874]:
* generic/tclUtil.c: Fix includes rooting all growth routines
by default on a commone tunable parameter TCL_MIN_GROWTH.
diff --git a/generic/tclInt.h b/generic/tclInt.h
index cde46ac..398d64c 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4169,8 +4169,8 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
*/
#define TclUtfToUniChar(str, chPtr) \
- ((((unsigned char) *(str)) < 0xC0) ? \
- ((*(chPtr) = (Tcl_UniChar) *(str)), 1) \
+ ((((unsigned char) *(str)) < 0xC0) ? \
+ ((*(chPtr) = (Tcl_UniChar) *(str)), 1) \
: Tcl_UtfToUniChar(str, chPtr))
/*
@@ -4243,8 +4243,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file,
*/
#define TclInvalidateNsCmdLookup(nsPtr) \
- if ((nsPtr)->numExportPatterns) { \
- (nsPtr)->exportLookupEpoch++; \
+ if ((nsPtr)->numExportPatterns) { \
+ (nsPtr)->exportLookupEpoch++; \
+ } \
+ if ((nsPtr)->commandPathLength) { \
+ (nsPtr)->cmdRefEpoch++; \
}
/*
diff --git a/tests/namespace.test b/tests/namespace.test
index 9d7cb59..f4e50bc 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -2517,6 +2517,22 @@ test namespace-51.17 {resolution epoch handling: Bug 2898722} -setup {
catch {rename ::c {}}
unset result
} -result {A 1 . A A . B B . B B . B B . B B . G G}
+test namespace-51.18 {Bug 3185407} -setup {
+ namespace eval ::test_ns_1 {}
+} -body {
+ namespace eval ::test_ns_1 {
+ variable result {}
+ namespace eval ns {proc foo {} {}}
+ namespace eval ns2 {proc foo {} {}}
+ namespace path {ns ns2}
+ variable x foo
+ lappend result [namespace which $x]
+ proc foo {} {}
+ lappend result [namespace which $x]
+ }
+} -cleanup {
+ namespace delete ::test_ns_1
+} -result {::test_ns_1::ns::foo ::test_ns_1::foo}
# TIP 181 - namespace unknown tests
test namespace-52.1 {unknown: default handler ::unknown} {