D 2014-11-14T17:49:14.387 L Dynamic\sStrings P 667ad23e8ccd75fd0d9d9f233597e022867bbcbd U dgp W 1348

Source Files

* portions of [/finfo?name=generic/tclUtil.c|tclUtil.c]

Public Interface

* struct Tcl_DString * Tcl_DStringInit * Tcl_DStringLength * Tcl_DStringValue * Tcl_DStringAppend * Tcl_DStringAppendElement * Tcl_DStringStartSublist * Tcl_DStringEndSublist * Tcl_DStringSetLength * Tcl_DStringFree

Private Interface

* TclDStringAppendDString * TclDStringAppendObj * TclDStringAppendLiteral * TclDStringClear

Directly Depends On Public Interface

* [Allocation]

Directly Depends On Private Interface of

* [List Parsing]

Discussion

Our good old friend the Tcl_DString! Taking care of the housekeeping of resizable arrays as long as we can remember. Like the [Hash Tables] the foundation is an open struct with some of the functions implemented as macros, which acts against any kind of evolution. The limitation here is that a string may only grow to INT_MAX bytes in size. Other problems are that DStrings grow but never shrink, and their memory waste factor scales linearly with size, so big strings have big waste. The simplest path may be to leave these structs unchanged, and just move away from using them for those tasks where their limitations are undesirable in Tcl 9. Z 6c22ec0627d10bffc9657097e6fbbc28