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

Modified Files:
        logdebug.c physdebug.c prettyp.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: prettyp.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/prettyp.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- prettyp.c   11 Jan 2008 10:47:02 -0000      1.18
+++ prettyp.c   17 Mar 2008 17:41:23 -0000      1.19
@@ -156,7 +156,7 @@
 init (stack *s)
 {
     s->sp   = 0;
-    s->lifo = PFarray (sizeof (int));
+    s->lifo = PFarray_default (sizeof (int));
 
     assert (s->lifo);
 }
@@ -417,9 +417,9 @@
      * first material to be printed
      */
     if (! collect) {
-        collect = PFarray (sizeof (char));
-        stream  = PFarray (sizeof (char *));
-        size    = PFarray (sizeof (int));
+        collect = PFarray (sizeof (char), 512);
+        stream  = PFarray (sizeof (char *), 50);
+        size    = PFarray (sizeof (int), 50);
 
         assert (collect && stream && size);
     }

Index: logdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/logdebug.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- logdebug.c  25 Feb 2008 15:37:05 -0000      1.96
+++ logdebug.c  17 Mar 2008 17:41:23 -0000      1.97
@@ -213,7 +213,7 @@
 static char *
 literal (PFalg_atom_t a)
 {
-    PFarray_t *s = PFarray (sizeof (char));
+    PFarray_t *s = PFarray (sizeof (char), 50);
 
     switch (a.type) {
 
@@ -257,7 +257,7 @@
 static char *
 xml_literal (PFalg_atom_t a)
 {
-    PFarray_t *s = PFarray (sizeof (char));
+    PFarray_t *s = PFarray (sizeof (char), 50);
 
     if (a.type == aat_nat)
         PFarray_printf (
@@ -309,7 +309,7 @@
 xml_literal_list (PFalg_simple_type_t ty)
 {
     bool first = true;
-    PFarray_t *s = PFarray (sizeof (char));
+    PFarray_t *s = PFarray (sizeof (char), 50);
 
     if (ty & aat_update)
         PFarray_printf (s, "update");
@@ -2188,7 +2188,7 @@
 {
     if (root) {
         /* initialize array to hold dot output */
-        PFarray_t *dot = PFarray (sizeof (char));
+        PFarray_t *dot = PFarray (sizeof (char), 32000);
 
         PFarray_printf (dot, "digraph XQueryAlgebra {\n"
                              "ordering=out;\n"
@@ -2238,7 +2238,7 @@
     if (root) {
 
         /* initialize array to hold dot output */
-        PFarray_t *xml = PFarray (sizeof (char));
+        PFarray_t *xml = PFarray (sizeof (char), 64000);
 
         PFarray_printf (xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
         PFarray_printf (xml, "<logical_query_plan unique_names=\"%s\">\n",

Index: physdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/physdebug.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- physdebug.c 25 Feb 2008 15:37:05 -0000      1.57
+++ physdebug.c 17 Mar 2008 17:41:23 -0000      1.58
@@ -125,7 +125,7 @@
 static char *
 literal (PFalg_atom_t a)
 {
-    PFarray_t *s = PFarray (sizeof (char));
+    PFarray_t *s = PFarray (sizeof (char), 50);
 
     switch (a.type) {
 
@@ -974,7 +974,7 @@
 {
     if (root) {
         /* initialize array to hold dot output */
-        PFarray_t *dot = PFarray (sizeof (char));
+        PFarray_t *dot = PFarray (sizeof (char), 32000);
 
         PFarray_printf (dot, "digraph XQueryPhysicalAlgebra {\n"
                              "ordering=out;\n"


-------------------------------------------------------------------------
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