Skip to content
Tcl Source Code History Of Ticket 2308236fffffffffffffffffffffffffffffffff
Login

History Of Ticket 2308236fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 2308236fffffffffffffffffffffffffffffffff

  1. Ticket change [a76d48f827] (rid 98794) by nijtmans on 2008-11-18 06:32:51:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Although the documentation states that this function returns a malloc'ed string, it's
      return type was const char*. This means that, since Tcl 8.4, users are forced to
      use an unsafe type cast to used it:
           char *s = (char *)Tcl_HashStats(....)
           ....
          ckfree(s);
      
      Fixing the signature has the effect that this type cast is no longer
      neccessary, so it is fully source and binary compatible.
      
      The signature is wrong since the implementation of TIP #27
      in Tcl 8.4
      
    4. foundin initialized to: "obsolete: 8.6a4"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "nijtmans"
    10. subsystem initialized to: "41. Memory Allocation"
    11. title initialized to: "signature of Tcl_HashStats() wrong"
    12. type initialized to: "Bug"
  2. Ticket change [1fd5c1d89a] (rid 91214) by nijtmans on 2008-11-18 14:04:19:

    1. closedate changed to: "2008-11-18T07:04:19"
    2. closer changed to: "nijtmans"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"
  3. Ticket change [56dd4040f3] (rid 94399) by nijtmans on 2008-11-18 14:04:34:

    1. icomment:
      fixed and backported to Tcl 8.5 branch
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  4. Ticket change [6ecc70810f] (rid 100204) by dgp on 2008-11-18 22:21:54:

    1. icomment:
      
      Just for the record, this change wasn't
      backported for 8.4.20, and I think that's
      the right decision.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [8310d9f3dd] (rid 117334) by nijtmans on 2008-11-19 05:02:37:

    1. icomment:
      Just for the record (2): This is how Tcl_HashStats() must be used in Tcl 8.5:
      
      char *s = (char *)Tcl_HashStats(t);
      ...... do something with it
      if (t->typePtr->flags & TCL_HASH_KEY_SYSTEM_HASH) {
          TclpSysFree((char *) tablePtr->buckets);
      } else {
          ckfree((char *) tablePtr->buckets);
      }
      
      The documentation didn't mention this, and apart from that the
      function TclpSysFree is not in the public API. So in Tcl 8.6 I modified
      this simply to:
      char *s = Tcl_HashStats(t);
      ...... do something with it
      ckfree((char *) tablePtr->buckets);
      
      I don't think that anyone would use Tcl_HashStats with
      hash tables with the TCL_HASH_KEY_SYSTEM_HASH flag
      set, so in practice it doesn't make a difference.
      
      At least, in Tcl 8.6 the function works now as documented.
      In Tcl 8.5 the signature is changed such that a type cast
      is not needed any more, but the further behavior is unchanged.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  6. Ticket change [97b8caf3cd] (rid 110485) by nijtmans on 2008-11-19 05:04:48:

    1. icomment:
      Oops, here are the right code snappets:
      
      In Tcl 8.5:
      char *s = (char *)Tcl_HashStats(t);
      ...... do something with it
      if (t->typePtr->flags & TCL_HASH_KEY_SYSTEM_HASH) {
      TclpSysFree(s);
      } else {
      ckfree(s);
      }
      
      In Tcl 8.6:
      char *s = Tcl_HashStats(t);
      ...... do something with it
      ckfree(s);
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  7. Ticket change [7bccbfc626] (rid 96966) by dgp on 2011-09-06 21:35:06:

    1. icomment:
      Now backported for 8.4.20 for reasons
      that are unclear but not worth arguing about to me.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [85489fe854] (rid 131287) by nijtmans on 2011-09-06 21:49:43:

    1. icomment:
      
      
      allow_comments - 1
      
      >Now backported for 8.4.20 for reasons
      >that are unclear but not worth arguing about to me.
      The reason is simple: I totally forgot about this
      already existing issue, and at that time I didn't
      think there ever would be a new Tcl 8.4 release...
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"