[m-rev.] Fwd: for review: fix obsolete tcl-tk code in extras/graphics/mercury_tcltk
Fabrice Nicol
fabrnicol at gmail.com
Fri Jan 7 07:23:54 AEDT 2022
Hi Julien,
> According the Tcl/Tk documentation TCL_DYANMIC is for when the memory
> referenced by the result field is allocated using the Tcl_Alloc()
> function. (Memory allocated by Mercury's GC is definitely *not*
> allocated using this function.)
>
> I think the safest approach here is to get the result string from
> Mercury, copy it into memory allocated using Tcl_Alloc() and then
> pass that to Tcl_SetResult().
>
Ok, I hope the attached patch sets things straight if TCL_DYNAMIC is to
be preferred.
In the process, I added a missing foreign_enum pragma for Mercury type
'tcl_status' (see commit message).
Fabrice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-mercury_tcltk-obsolete-result-fields.patch
Type: text/x-patch
Size: 2207 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20220106/c335c5ba/attachment.bin>
More information about the reviews
mailing list