Overview
| Artifact ID: | 6294d03579487e1ab7ba7ce272d79a90a6cf327fbc52daec0e2f2e37d630a92b |
|---|---|
| Ticket: | c9663296fd31fbb2fa1ff1cf019b59f432983516
GrowStringBuffer and GrowUnicodeBuffer do not check for overflows |
| User & Date: | chrstphrchvz on 2023-05-05 13:07:04 |
Changes
- icomment:
The changes discussed here can probably be used to address [69b4f7eb37], at least in newer Tcl. I had similar ideas there about adjusting the memory allocation growth algorithm. Other ideas (which I am not knowledgeable enough to know if they are good ones) might be to have some <tt>TCL_MAX_GROWTH</tt> amount, or to keep track of large buffers so Tcl can go back and free unused memory before trying malloc again (or possibly in response to a memory pressure notification from the OS). And while I am aware Tcl was mostly written when computers had far less RAM, many of its memory allocation panics do not seem strictly necessary, but were likely easier to implement than returning errors, or out of the assumption that the stability of the entire system is compromised once <tt>malloc()</tt> fails.
- login: "chrstphrchvz"
- mimetype: "text/x-fossil-wiki"