Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3316
Modified Files:
serialize_pftijah.mx
Log Message:
- Remove excessive GDKalloc()/GDKfree() for INEX stack. Suppose
#define XML_MAX_NAMELEN 100 in libxml2/parserInternals.h also
limits tagnames to 100.
U serialize_pftijah.mx
Index: serialize_pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/serialize_pftijah.mx,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- serialize_pftijah.mx 25 Sep 2009 07:22:33 -0000 1.79
+++ serialize_pftijah.mx 25 Sep 2009 07:31:13 -0000 1.80
@@ -206,6 +206,9 @@
#ifdef USE_INEX_PATH
+/* this def is copied from libxml2/parserInternals.h */
+#define XML_MAX_NAMELEN 100
+
/*
* Start of the implementation of the INEX path generator. During indexing
* this structure will keep track of the used tags in the current path. The
@@ -238,7 +241,7 @@
int prev_frame; /* previous level frame, -1 for bottom */
} level;
struct {
- str strVal; /* string value of the tagname */
+ char strVal[XML_MAX_NAMELEN];/* string value of tagname */
int cnt; /* number of times used at this level */
} tag;
} IpgFrame;
@@ -252,7 +255,7 @@
char* pathbuff; /* the path printing buffer */
} IpgBase;
-#define IPG_INIT_STACKSZ 512
+#define IPG_INIT_STACKSZ 256
#define IPG_INIT_PATHSZ 8192
@@ -279,7 +282,10 @@
base->top = 0;
base->stack[base->top].level.ntags = 0;
base->stack[base->top].level.prev_frame = -1;
- sprintf(base->pathbuff,"fn:doc(\"%s\")",doc);
+ if ( 1 /* Henning: use docnames in path */ )
+ sprintf(base->pathbuff,"fn:doc(\"%s\")",doc);
+ else
+ sprintf(base->pathbuff,"%s","");
base->stack[base->top].level.subpath = strlen(base->pathbuff);
return 1;
}
@@ -313,7 +319,7 @@
ipg_frame_alloc(base);
base->stack[base->top].level.ntags++;
found = &
base->stack[base->top+base->stack[base->top].level.ntags];
- found->tag.strVal = (str)GDKstrdup(tag);
+ strcpy(found->tag.strVal,tag);
found->tag.cnt = 0;
}
found->tag.cnt++;
@@ -338,15 +344,10 @@
return 1;
}
-static int ipg_poptag(IpgBase* base) {
- /* free tag strings used at the top level */
- for(int i=0; i< base->stack[base->top].level.ntags; i++) {
- GDKfree(base->stack[base->top+i+1].tag.strVal);
- }
-
+static INLINE int ipg_poptag(IpgBase* base) {
base->top = base->stack[base->top].level.prev_frame;
- if (0) stream_printf(GDKout,"-IPG[pop: path=%s]\n",base->pathbuff);
+ /* stream_printf(GDKout,"-IPG[pop: path=%s]\n",base->pathbuff); */
return 1;
}
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins