Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bab17a2ae24b41eeadbdf1f08bac186f3e1895e707a77b39522a001d66112f10
Ticket: 32337edbd60e90c1d6aaa9c9b0a681c2abb4950c
TclStackAlloc argument type
User & Date: jan.nijtmans on 2019-02-02 18:10:45
Changes

  1. closedate changed to: "2458517.2574676"
  2. closer changed to: "jan.nijtmans"
  3. icomment:
    The only modification I see in the TclStackAlloc() call is removal of the (unsigned) cast. This type cast is useless: since TclStackAlloc() has an int argument, overflow is always possible, it was and still is.
    
    Since TclStackAlloc() is meant to allocate a small number of 'things', and general the call does something like TclStackAlloc(numThings * sizeof(thing)), I don't think much can be done without changing the argument of TclStackAlloc() to something bigger as int. That's already done in Tcl 9.0.
    
    So, I would suggest to leave it as-is for the Tcl-8 line, it's not worth the trouble. as long as numThings is small compared to the total memory, it will continue to work fine.
    
    For Tcl-9 it's fixed already, since TclStackAlloc() got a size_t argument. For 32-bit platforms it can handle double the sizes as it could in Tcl-8. For 64-bit platforms, there's practically no limit any more.
    
  4. login: "jan.nijtmans"
  5. mimetype: "text/plain"
  6. resolution changed to: "Works For Me"
  7. status changed to: "Closed"