develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #119515] [PATCH] [DOCFIX] - DynaLoader referencesdeprecated newXSUB

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
August 30, 2013 13:00
Subject:
Re: [perl #119515] [PATCH] [DOCFIX] - DynaLoader referencesdeprecated newXSUB
Message ID:
20130830130001.GS66035@plum.flirble.org
On Fri, Aug 30, 2013 at 08:45:42AM -0400, Matthew Horsfall (alh) wrote:
> On Fri, Aug 30, 2013 at 8:38 AM, Nicholas Clark <nick@ccl4.org> wrote:
> 
> > On Fri, Aug 30, 2013 at 08:18:59AM -0400, Matthew Horsfall (alh) wrote:
> > > How would we avoid the strlen call?
> > >
> > > It looks like newXS_len_flags() still needs the length of char *
> > perl_name
> > > passed to it.
> >
> > Yes. The length is known, but being throw away by the XS typemap:
> >
> > void
> > dl_install_xsub(perl_name, symref, filename="$Package")
> >     char *              perl_name
> >     void *              symref
> >     const char *        filename
> >
> >
> > Change char *perl_name to SV *perl name, and one can get the length.
> > (And, like every other filename interaction, start to wonder which
> > character
> > set the OS was expecting. Rather than pretending to ignore it)
> >
> 
> Ah.
> 
> I'd like to try my hand at patching that then. It *sounds* simple, unless
> your note about the character set means it's going to be far more
> complicated...

Well, I think that the least worst approach for now is to change perl_name
to be SV *, and then use SvPVbyte() to get a char * pointer and the length.

Nicholas Clark

Thread Previous | Thread Next


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