Overview
| Artifact ID: | bab17a2ae24b41eeadbdf1f08bac186f3e1895e707a77b39522a001d66112f10 |
|---|---|
| Ticket: | 32337edbd60e90c1d6aaa9c9b0a681c2abb4950c
TclStackAlloc argument type |
| User & Date: | jan.nijtmans on 2019-02-02 18:10:45 |
Changes
- closedate changed to: "2458517.2574676"
- closer changed to: "jan.nijtmans"
- 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.
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Works For Me"
- status changed to: "Closed"