CC: | pratzlaff [...] cfa.harvard.edu |
Subject: | ffgkls() frees to wrong pool on MS Windows |
Hi,
The ffgkls function produces a "Free to wrong pool..." error on MS Windows.
As I understand it, 'free' currently calls 'PerlMem_free', but we need
the system 'free' to be called.
This small patch to CFITSIO.xs removes the error:
########################################
--- CFITSIO.xs_orig 2012-02-15 22:01:33 +1100
+++ CFITSIO.xs 2012-02-15 22:02:39 +1100
@@ -7655,6 +7655,9 @@
comment=(ST(3)!=&PL_sv_undef) ? get_mortalspace(FLEN_COMMENT,TBYTE) :
NULL;
RETVAL=ffgkls(fptr,keyname,&longstr,comment,&status);
sv_setpv(ST(2),longstr);
+#ifdef WIN32
+#undef free
+#endif
free(longstr);
OUTPUT:
comment
########################################
Cheers,
Rob