Stories
Slash Boxes
Comments
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Rather than copying the malloc()ed string into an SV and then free()ing it, check out sv_usepvn which can directly take over the buffer. Sorry, I don't know the XS-fu to create a typemap to make your wrapper use this automatically.

    Maybe that useful function should be re-named sv_borg to make it stand out more.

    • [sv_usepvn]

      Nice! I was looking for something like that. In fact, I always blindly assumed that the 'char *' typemap would only copy the pointer and not the whole vector (till I realized that it does exactly that yesterday).

      I think this can be turned into a typemap easily. AFAIK, there is no default typemap for 'const char*' so I can use that.

      Maybe that useful function should be re-named sv_borg to make it stand out more.
       
      :-) Guess what: the curious Poison() macro did immediately spring into my