in reply to Re: Writing to Pointer Values (PV) in XS
in thread Writing to Pointer Values (PV) in XS

Hi! So I have news on this implementation.

I would like to put a note here.

HUGE SUCCESS!

You can see this implementation on our repo. The relevant files are the XS and the example script .

What are the fragile issues that you can see? What more can I do ensure memory handling is done correctly

  • Comment on Re^2: Writing to Pointer Values (PV) in XS

Replies are listed 'Best First'.
Re^3: Writing to Pointer Values (PV) in XS
by ikegami (Patriarch) on Jun 24, 2010 at 18:06 UTC

    You can see this implementation on our repo.

    I'm not going to review your code.

    newSV_type is a new addition to the core. If you want to support older Perls, you'll have to use something else, or include ppport (which isn't hard, and will handle other such problems if any). I chose newSV_type because it doesn't create a string buffer that will end up being freed.

    What are the fragile issues that you can see?

    I was referring to how easy it is to accidentally replace the PV. If it's a private interface between your XS and Perl components, no problem. If it's a public interface, it's a problem.

    What more can I do ensure memory handling is done correctly

    Test your code using valgrind.