On 1 January 2016 at 20:30, Eli Zaretskii <[email protected]> wrote: > If Perl uses its own malloc/free, then we cannot pass to Perl memory > allocated in XSParagraph that Perl could free, and we cannot free any > memory Perl passes to us. Is such a scenario plausible? Are we sure > that we only ever free memory that we ourselves allocated, and never > pass to Perl memory we allocated?
malloc and free, apparently, given that the right header files have been included: https://lists.gnu.org/archive/html/texinfo-devel/2015-07/msg00062.html No Perl header files are included in text.c. The only place in the source I can see where this could cause a problem is around line 877 of xspara.c, here: free (new_space.text); in xspara_add_text. Is the crash still coming from XS_Texinfo__Convert__XSParagraph__XSParagraph_new? If so I don't understand it because there should be no free-ing there after the patch I posted. I think a simple way to remove the problem, in the call to free here at least, is to add a function to text.c which can be called instead to avoid using Perl's version of free.
