Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 726b73da1c1407998ce56d1689085f46c4ed961d
Ticket: 1158008fffffffffffffffffffffffffffffffff
new list internal rep
User & Date: msofer on 2005-03-07 01:05:59
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Attached a patch against HEAD that changes the internal
    reps of objects. The changes are:
    
    (1) The List struct is now growable and contains the
    pointers to the list elements at the end. This reduces
    the number of mallocs in list creation from 2 to 1.
    
    (2) The List struct is now refcounted. This permits
    insuring that the pointers to the list elements survive
    a possible shimmering of the object (by increasing the
    ref count). This is now use in Tcl_EvalObjEx (pure list
    opt) and TclLsetList (so that it calls TclLsetFlat)
    
    (3) All empty lists in a thread share the same List
    internal rep. In this manner, an empty list can be
    allocated and reserved without any malloc/free calls
    
    The patch passes the testsuite. It has not been tested
    for leaks yet. There shouldn't be any ...
    
    CAVEAT: callers of Tcl_ListObjGetElements should *not*
    change the elements, even if the Tcl_Obj is unshared
    (as its internal rep may be shared). This was IMO
    already an abuse of the api, but it is valid in the
    unpatched implementation and invalid with the patch.
    The docs are silent about this; they do not even
    mention that the Tcl_Obj should not be shared for an
    edit to be valid. Maybe throw some new CONST into that api?
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "14. List Object"
  10. title changed to: "new list internal rep"
  11. type changed to: "Patch"