From: Harald O. <har...@el...> - 2025-05-02 12:05:29
|
Am 02.05.2025 um 13:22 schrieb Jan Nijtmans: > Op do 1 mei 2025 om 11:22 schreef Jan Nijtmans: >> >> This is a CFV warning for TIP #717. for Tcl 9.1+: >> New function: Tcl_AttemptCreateHashEntry() >> <https://core.tcl-lang.org/tips/doc/trunk/tip/717.md> > > Since it turns out that Tcl_InitStringRep() has the > same problem, and can benefit from the same > solution, the title changed: > New functions: Tcl_AttemptCreateHashEntry(), Tcl_AttemptInitStringRep() > <https://core.tcl-lang.org/tips/doc/trunk/tip/717.md> > > If you think this is a bad idea, speak up now. If not, > I'll start the vote in a few days. > > Regards, > Jan Nijtmans Jan, I generally appreciate the "attempt" functions to get fails instead panic on memory issues. Nevertheless, Tcl_InitStringRep: * is not documented in the docs * the introducing TIP 445 documents the NULL as return on memory error. So, I think that this is ok and no "attempt" version of this call is required. If the function currently paniced, it was an error following the TIP. Tcl_CreateHashEntry is different. It existed in Tcl 8.6 and a NULL-return on memory issues is not documented. So, this is a good candidate to be member of the Atempt family. Does this sounds right? Harald |