NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Re: XS/guts Expert help needed (Score:1)
Aren't you calloc()ing a char buffer without free()ing it.
John.
--
Re: XS/guts Expert help needed (Score:2)
Reply to This
Parent
Re: (Score:2)
Re: (Score:1)
Re: (Score:2)
Re: (Score:1)
SV *
getline(str)
SV * str
CODE:
{
STRLEN len;
char *cval = SvPV(str, len);
Re: (Score:2)
Re: (Score:1)
CLEANUP section:
CLEANUP:
free (ret);
Custom typemap: in a typemap file:
TYPEMAP
char_own * T_CHAR_OWN
OUTPUT
T_CHAR_OWN
sv_setpv ((SV*)$arg, $var);
g_f
Re: (Score:1)
But you shouldn't use calloc() or other system level memory allocation routines. You should use New() or one of its variants. This is because Perl may be configured to use its own malloc routines and using the system ones at the same time could lead to issues. IOW, it might work fine for you on your box but might go disasterously wrong when built on a Perl with a different configura