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 12:39
Subject:
Re: [perl #119515] [PATCH] [DOCFIX] - DynaLoader referencesdeprecated newXSUB
Message ID:
20130830123853.GR66035@plum.flirble.org
On Fri, Aug 30, 2013 at 08:18:59AM -0400, Matthew Horsfall (alh) wrote:
> On Fri, Aug 30, 2013 at 7:43 AM, Nicholas Clark <nick@ccl4.org> wrote:
> 
> > I'm wary of documenting exactly the current state, as I see that
> > newXS_len_flags() would be preferable to what we have, as it would avoid a
> > needless strlen() call.
> >
> 
> 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)

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