[EMAIL PROTECTED] wrote:
> 
> Hi,

> I want to return a reference to a new SVpv, but the SVpv should
> neither allocate any string space nor try to delete some on destruction.
> 
> I have an address in a memory mapped region and I want to stuff that
> into the PVX slot and set the length myself, or to say it another way,
> I want something similar to newSVpvn but WITHOUT copying the string,
> just setting the PVX pointer and the LEN fields. Furthermore that SV
> should become readonly and Perl should never try to free that 'foreign'
> storage.
> 
> Is this possible with the current API or do I have to hack the perl
> structures?

Nice question!  The way I have done this in the past is to use an extra
level of pointer indirection, and treat the address I want to store as a
data value itself, and then to dereference the extra level of
indirection when I actually want to use the pointer.

Alan Burlison

Reply via email to