From: Petr P. <pa...@us...> - 2003-11-07 15:26:20
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv15817 Modified Files: XPathContext.xs Log Message: using #define PERL_NO_GET_CONTEXT and dTHX in static functions, to make perl API calls faster Index: XPathContext.xs =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- XPathContext.xs 5 Nov 2003 13:41:52 -0000 1.38 +++ XPathContext.xs 7 Nov 2003 15:26:16 -0000 1.39 @@ -3,6 +3,7 @@ #ifdef __cplusplus extern "C" { #endif +#define PERL_NO_GET_CONTEXT /* we want efficiency */ /* perl stuff */ #include "EXTERN.h" @@ -59,6 +60,7 @@ { va_list args; SV * sv; + dTHX; /* xmlParserCtxtPtr context = (xmlParserCtxtPtr) ctxt; */ sv = NEWSV(0,512); @@ -91,6 +93,7 @@ SV * pnode2; STRLEN len; char * strkey; + dTHX; if (XPathContextDATA(ctxt)->pool == NULL) { if (pnode == NULL) { @@ -121,6 +124,7 @@ static xmlXPathObjectPtr xpc_LibXML_perldata_to_LibXMLdata(xmlXPathParserContextPtr ctxt, SV* perl_result) { + dTHX; if (!SvOK(perl_result)) { return (xmlXPathObjectPtr)xmlXPathNewCString(""); } @@ -216,6 +220,7 @@ static void xpc_LibXML_restore_context(xmlXPathContextPtr ctxt, xmlXPathContextPtr copy) { + dTHX; /* cleanup */ if (XPathContextDATA(ctxt)) { /* cleanup newly created pool */ @@ -258,6 +263,7 @@ xmlXPathContextPtr copy; XPathContextDataPtr data; I32 count; + dTHX; dSP; ctxt = (xmlXPathContextPtr) varLookupData; @@ -320,6 +326,7 @@ char *strkey; const char *function, *uri; SV **perl_function; + dTHX; dSP; SV * data; xmlXPathContextPtr copy; |