in reply to Passing reference to perl from C code

If I remeber what I've read correctly (and if I haven't someone will let me know), if you are just calling a subroutine the memory should be released when the subroutine is finished. If it isn't you can use the G_EVAL flag which will make sure the memory is released.

If perl does keep the memory contents, when you pass your pointer it should overwrite the memory contents with your new info, or take advantage of the fact and just send the info that needs updating (you will need to change the perl script to accept this).

I do not have the time to write a test script, but if you do try these suggestions I would be interested in finding out how it works.

  • Comment on Re: Passing reference to perl from C code