On Thu, 6 Apr 2006, Igor Sysoev wrote:

is the effective way to return data from XS to perl without unnecessary
memory coping ? As I understand

1) if I return char*, then perl creates SV and copies the string to SV.

2) if I create SV using newSVpvn() and return it, then newSVpvn() copies
  string to SV, then perl creates another SV (because my SV is mortal)
  and again copies the string to its SV.

Sorry, I was mistaken. When perl creates another SV from my SV, it
copies the pointer only but not a whole data.


Igor Sysoev
http://sysoev.ru/en/

Reply via email to