On Thu, Jan 26, 2006 at 08:52:53AM -0800, Gisle Aas wrote:
> Tim Bunce <[EMAIL PROTECTED]> writes:
> 
> > On Thu, Jan 26, 2006 at 02:34:09AM -0800, Gisle Aas wrote:
> > > Tim Bunce <[EMAIL PROTECTED]> writes:
> > > 
> > > > (Any need adding to Driver.xst?)
> > > 
> > > No.  It only contains XS functions and these always get my_perl passed
> > > (which is wasted unless PERL_NO_GET_CONTEXT is used), but if we also
> > > patch up Driver_xst.h then drivers are free to add PERL_NO_GET_CONTEXT
> > > if/when they care.
> > > 
> > > I tried it with DBD-mysql-3.0002 and it compiled&tested fine when all
> > > I did was adding "#define PERL_NO_GET_CONTEXT\n" at the start of its
> > > mysql.xs file.  Seems almost too easy :)
> > 
> > It does.
> 
> The main reason it was so easy is that all the interesting code lives
> in dbdimp.c.  If I also enable PERL_NO_GET_CONTEXT for this file there
> is certainly various functions that need to have dTHX added to them,
> but this also becomes an opportunity to make the driver even more
> efficient by using aTHX_/pTHX_ to pass my_perl where the interfaces
> are internal to that driver only.
> 
> I think it makes sense to PERL_NO_GET_CONTEXTify some drivers this way
> before we start investigating how to avoid the dTHX overhead in the
> public functions that are provided by DBI.xs itself.

I agree. Any chance yould you patch lib/DBI/DBD.pm to add in a section
describing what driver authors need to do?

Tim.

Reply via email to