>>>>> "jarausch" == jarausch <[EMAIL PROTECTED]> writes:
jarausch> I have an address in a memory mapped region and I want
jarausch> to stuff that into the PVX slot and set the length
jarausch> myself, or to say it another way, I want something
jarausch> similar to newSVpvn but WITHOUT copying the string, just
jarausch> setting the PVX pointer and the LEN fields. Furthermore
jarausch> that SV should become readonly and Perl should never try
jarausch> to free that 'foreign' storage.
Do you want to read this memory from Perl or just pass around an
opaque handle?
If the first, try using
SvPVX(sv) = ptr;
SvLEN(sv) = SvCUR(sv) = len_of_ptr;
SvREADONLY_on(sv);
If the second, read up on '~' magic in perlguts.
--
Stephen
"Farcical aquatic ceremonies are no basis for a system of government!"