Update of /cvsroot/monetdb/pathfinder/compiler/xmlimport
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24398/xmlimport

Modified Files:
        xml2lalg.c xml2lalg_xpath_utils.c 
Log Message:
-- Extended the PFarray_t type to store a ``clear'' bit
   that ensures that memory is erased during allocation.

-- Split up PFarray (size_t itemsize) into four variants

   o PFarray_default (size_t itemsize),
   o PFcarray_default (size_t itemsize),
   o PFarray (size_t itemsize, unsigned int slots), and
   o PFcarray (size_t itemsize, unsigned int slots)

   where the '_default' variants are currently seeded with 20 slots,
   the 'c' variants provide a cleared chunk of memory, and the slots
   argument indicates how much memory is initially allocated (#slots).

-- Added memory debugging support for arrays:
   If the environment variable ``PF_DEBUG_MEMORY'' is set the memory
   reallocation for arrays reports the function that requires more
   memory (and thus more slots for the storage).


REMARK: Currently the inital array sizes (#slots) are good guesses
        about the upper limit of required slots. Anybody adding new
        PFarray calls may start with a very low value. This way the
        the debug printing may report (reallocation) problems in
        comparison to a very high initial value whose consequences
        might not be directly visible.



Index: xml2lalg.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- xml2lalg.c  25 Feb 2008 08:58:43 -0000      1.18
+++ xml2lalg.c  17 Mar 2008 17:41:31 -0000      1.19
@@ -464,7 +464,7 @@
    
     ctx = (XML2LALGContext*) PFmalloc (sizeof (XML2LALGContext));
 
-    ctx->nodeStore = PFarray(sizeof (PFla_op_t*));
+    ctx->nodeStore = PFarray(sizeof (PFla_op_t*), 200);
 
     return ctx;  
 }
@@ -2533,7 +2533,7 @@
     </key>)+
     */
 
-    PFarray_t * keyPositions = PFarray (sizeof (int));
+    PFarray_t * keyPositions = PFarray (sizeof (int), 5);
 
 
     xmlXPathObjectPtr keys_xml =  XPATH(xpathExpression);

Index: xml2lalg_xpath_utils.c
===================================================================
RCS file: 
/cvsroot/monetdb/pathfinder/compiler/xmlimport/xml2lalg_xpath_utils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xml2lalg_xpath_utils.c      25 Feb 2008 15:37:08 -0000      1.7
+++ xml2lalg_xpath_utils.c      17 Mar 2008 17:41:31 -0000      1.8
@@ -225,7 +225,7 @@
     xmlXPathObjectPtr xpathObjectPtr)
 {
 
-    PFarray_t * values = PFarray (sizeof (char*));
+    PFarray_t * values = PFarray (sizeof (char*), 20);
 
     int nodeCount = PFxml2la_xpath_getNodeCount(xpathObjectPtr);
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to