develooper Front page | perl.perl5.porters | Postings from May 2008

Re: on the almost impossibility to write correct XS modules

From:
demerphq
Date:
May 21, 2008 08:56
Subject:
Re: on the almost impossibility to write correct XS modules
Message ID:
9b18b3110805210856v22151b76o7412a7906fc0720e@mail.gmail.com
2008/5/21 Glenn Linderman <perl@nevcal.com>:
> On approximately 5/21/2008 1:29 AM, came the following characters from the
> keyboard of Rafael Garcia-Suarez:
>
>> Some way to mark PVs as "binary" and not upgradeable to SvUTF8 would be
>> handy, though.
>
>
> What's the goal?
>
> If, during the lifetime of a binary string, data gets attached to it that
> makes it get upgraded, and later that data is detached, and the storage
> format is truly transparent, then when the string is used in a context that
> needs bytes, it should be handled properly (if not, let's fix that bug),
> either by downgrading, or by accessing the data and validating that the
> values are each < 256 (which downgrading does as a side effect).

So how would that work exactly? Seriously. Give a general framework
about how it would work. Consider that if it makes things massively
slower that its probably not going to fly.

>
> If the goal is to prevent the cost of upgrading and downgrading, well, just
> fix the bug that attached the upgraded data... and the cost of doing so also
> vanishes.

I dont think its so easy. The code responsible may be very hard to identify.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About