Artifacts Associated With Ticket 219068ffffffffff
Ticket change [aa008fa95e] (rid 99249) by nobody on 2000-10-26 01:10:10:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 4557 RFE Version: 8.3 SubmitDate: '2000-03-24' LastModified: '2000-05-08' Severity: MED Status: Released Submitter: ericm ChangedBy: ericm OS: All FixedDate: '2000-05-08' FixedInVersion: 8.4a1 ClosedDate: '2000-10-25' Sometimes when I'm trying to do performance tuning on my code it's helpful to see how the hash tables I'm using are populated. Plus, this is kind of a neat, gee-whiz function. So, it'd be nice if Tcl_HashStats was accessible from Tcl, via "array statistics": *** tclVar.c 2000/01/21 03:29:14 1.16 --- tclVar.c 2000/03/28 21:44:21 *************** *** 2861,2870 **** enum {ARRAY_ANYMORE, ARRAY_DONESEARCH, ARRAY_EXISTS, ARRAY_GET, ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE, ! ARRAY_STARTSEARCH, ARRAY_UNSET}; static char *arrayOptions[] = { "anymore", "donesearch", "exists", "get", "names", "nextelement", ! "set", "size", "startsearch", "unset", (char *) NULL }; Interp *iPtr = (Interp *) interp; --- 2861,2870 ---- enum {ARRAY_ANYMORE, ARRAY_DONESEARCH, ARRAY_EXISTS, ARRAY_GET, ARRAY_NAMES, ARRAY_NEXTELEMENT, ARRAY_SET, ARRAY_SIZE, ! ARRAY_STARTSEARCH, ARRAY_STATISTICS, ARRAY_UNSET}; static char *arrayOptions[] = { "anymore", "donesearch", "exists", "get", "names", "nextelement", ! "set", "size", "startsearch", "statistics", "unset", (char *) NULL }; Interp *iPtr = (Interp *) interp; *************** *** 3178,3183 **** --- 3178,3198 ---- varPtr->searchPtr = searchPtr; break; } + + case ARRAY_STATISTICS: { + char *stats; + stats = Tcl_HashStats(varPtr->value.tablePtr); + if (stats != NULL) { + Tcl_SetResult(interp, stats, TCL_VOLATILE); + ckfree((void *)stats); + } else { + Tcl_SetResult(interp, "error reading array statistics", + TCL_STATIC); + return TCL_ERROR; + } + break; + } + case ARRAY_UNSET: { Tcl_HashSearch search; Var *varPtr2; - eric Good thing for 8.4, but the patch is not fully correct (half missing). -- 03/27/2000 hobbs Whoops -- darn cut-n'-paste. The above patch is now complete (as far as the C source goes anyway). - eric -- 03/28/2000 ericm Done. - eric -- 05/08/2000 ericm - foundin initialized to: "obsolete: 8.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "07. Variables"
- title initialized to: "Expose Tcl_HashStats at the Tcl level"
- type initialized to: "Bug"
Ticket change [1debf08f7a] (rid 90887) by welch on 2000-10-26 08:34:07:
- closedate changed to: "2000-10-26T01:34:07"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"