At first pass, I would probably go with the idea of copying the data to/from Perl variables as needed.
However, I admit I like the idea of just being able to pass a blessed pointer to Perl. So, how about a middle ground? For the free-able objects, go ahead and pass the bless pointer. For the none-free-able, allocate a struct, memcpy the data, then pass the new pointer as a blessed pointer. Since you allocated the memory, it is free-able.
In reply to Re: Managing C library memory in XS
by RonW
in thread Managing C library memory in XS
by petermogensen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |