Author: Ashok P. Nadkarni <[email protected]>
Vote-Summary: Accepted 3/0/0
Votes-For: BG, JN, SL
Tcl_DString abstraction is very useful in incrementally building
strings and binary data. In common usage in extensions, the resulting string
is used to initialize a
Tcl_Obj and the source
Tcl_DString freed. This
involves allocating new storage and a byte copy and is not efficient. Within
the core, the function
TclDStringToObj provides a more efficient means
which moves the allocated storage to the
Tcl_Obj and resets the
Tcl_DString. This TIP proposes making this function available to
The following function will be exported via the stubs table.
Tcl_Obj *Tcl_DStringToObj(Tcl_DString *dsPtr);
The function returns a
Tcl_Obj initialized with the content of
is then reinitialized to an empty string.
Implementation is available in the tip-651 branch of the Tcl repository.
This document has been placed in the public domain.