Excerpts from the mail message of Reza Naima:
)
) Dude, I finally got it working!!! And i'm pissed at what my
) biggest problems have been. It turns out that if i have a
) function in an xsub that does a malloc, then it segfaults,
) haowever, if the xsub function calls a c function that does a
) malloc, (same with the appropriate free) then it works fine!
) Everything works great now. but I can't figure out what the
) difference would be.
free()/malloc() from Perl space often does different things from
free()/malloc() from C space due to #define's and/or routines by
those names in a Perl library overriding the same-named routines
in a C run-time library.
So a malloc() in C requires a free() in C. I can't think of any
reason why a malloc() in XS can't work with a free() in XS, but
don't mix malloc()/free() with what sv_grow() and friends do
[don't call realloc() on what SvPV() returns, for example].
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)