Skip to content
Tcl Source Code History Of Ticket 1158008fffffffff
Login

History Of Ticket 1158008fffffffff

Artifacts Associated With Ticket 1158008fffffffff

  1. Ticket change [726b73da1c] (rid 100859) by msofer on 2005-03-07 01:05:59:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "msofer"
    9. subsystem initialized to: "14. List Object"
    10. title initialized to: "new list internal rep"
    11. type initialized to: "Patch"
  2. Ticket change [98df6de49a] (rid 110683) by msofer on 2005-03-07 08:05:59:

    1. icomment:
      
      
      File Added - 124431: listPatch
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Add attachment "listPatch" [3a11165c8e] (rid 112500) by msofer on 2005-03-07 08:05:59.

  4. Ticket change [72f573e413] (rid 104960) by msofer on 2005-03-09 02:11:12:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Joe English remarks that TSD access may be expensive, so
      that the proposed sharing of empty lists may not be
      worthwhile. One solution is to alloc them on demand (code
      for that is #if-zeroed out in the patch), another one is to
      define a struct for thread-specific data, store a pointer in
      a tsd and another pointer (at creation time) in each interp
      in that thread. 
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  5. Ticket change [a9058c9320] (rid 99082) by dkf on 2005-04-01 19:13:45:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      I'm not convinced yet that combining the array and the
      structure is a good idea. Perhaps pooling the List instances
      would be a better approach, but that's impossible with
      var-length structures.
      
      I also wonder whether sharing the List just within an Interp
      would be easier?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [053a91351e] (rid 89022) by msofer on 2005-04-02 08:56:05:

    1. status changed to: "Pending"
  7. Add attachment "listPatch2" [0580391f62] (rid 89078) by msofer on 2005-04-02 08:56:06.

  8. Ticket change [094022867b] (rid 89688) by msofer on 2005-04-02 08:56:06:

    1. assignee changed to: "dkf"
    2. closedate changed to: "2005-04-02T01:56:06"
    3. closer changed to: "msofer"
    4. icomment:
      
      
      File Added - 128163: listPatch2
      
      Logged In: YES 
      user_id=148712
      
      New patch attached (committed to HEAD). Changes are:
      
      * better resolution of the "empty list" issue: an empty
      Tcl_Obj is always returned in that case, calling
      Tcl_ListObjGetElements on it returns length==0 and
      objv==NULL. All list ops know how to detect and operate with
      empty lists.
      
      * warning in the docs about not mucking with the contents of
      the array returned by Tcl_ListObjGetElements is strengthened
      
      This dissolves the TSD issue, as there is no sharing of
      empty List structs.
      
      Leaving "Pending" and assigning to donal for clarification
      of the issues with the var-length structs.
      
      
    5. login: "msofer"
    6. mimetype: "text/plain"
    7. resolution changed to: "Accepted"
    8. username: "msofer"
  9. Ticket change [439012f13a] (rid 116577) by dkf on 2005-04-05 21:36:32:

    1. closedate changed to: "2005-04-05T14:36:32"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      My #1 issue is that var length structures are a mess. They
      require all sorts of nasty things to work with them, and
      must be tested rigorously on lots of architectures because
      of alignment issues. :^(
      
      If we pool List instances, the likely number of allocations
      per list creation is still just one and we don't have to do
      address munging to make it all "just work".
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"
  10. Ticket change [cf0c30ae32] (rid 112891) by dkf on 2005-04-05 22:41:12:

    1. closedate changed to: "2005-04-05T15:41:12"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      Random thought: I wonder whether it would be possible to
      allocate List instances from the same pool as Tcl_Objs?
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"
  11. Ticket change [da9ea8e59d] (rid 107819) by msofer on 2005-04-05 23:19:28:

    1. status changed to: "Open"
  12. Ticket change [7dd877eef3] (rid 97301) by jenglish on 2005-04-25 14:02:53:

    1. icomment:
      Logged In: YES 
      user_id=68433
      
      See also: #1189274  and #1178805.
      
      I don't think all the special-case checks for empty lists
      and all the new bugs (including the ones that haven't been
      discovered yet) are worth trying to save a malloc() here and
      there.  Please reconsider the empty list special case.
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  13. Ticket change [9c26a1e5df] (rid 111234) by dkf on 2005-04-25 17:05:42:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Assigning to the person who started checking in code since
      it seems to have caused someone problems.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  14. Ticket change [f1db90c5c3] (rid 109432) by msofer on 2006-09-30 00:31:39:

    1. closedate changed to: "2006-09-29T17:31:39"
    2. closer changed to: "msofer"
    3. status changed to: "Closed"
  15. Ticket change [c15a9a2381] (rid 111307) by dgp on 2011-05-06 01:03:34:

    1. icomment:
      Six years later, the question about all the empty list
      special case effort arises again.  Please compare
      core-8-5-branch and dgp-list-simplify and tell me
      what benefits of avoiding List allocation for empty
      lists I'll be sorry doing without on the dgp-list-simplify branch.
      Thanks.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"