Update of /cvsroot/monetdb/MonetDB4/src/monet
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21179/src/monet

Modified Files:
      Tag: MonetDB_4-20
        yytree.mx 
Log Message:
make M4 work on sparcs again. 
data of type lng/dbl should on sparcs always be aligned on 8 bytes.
In the the yytree ValRecords were created which were aligned on 4 bytes
leading to a very early crash of m4.


Index: yytree.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/monet/yytree.mx,v
retrieving revision 1.6
retrieving revision 1.6.6.1
diff -u -d -r1.6 -r1.6.6.1
--- yytree.mx   25 Apr 2007 09:02:00 -0000      1.6
+++ yytree.mx   5 Oct 2007 20:20:05 -0000       1.6.6.1
@@ -143,7 +143,9 @@
                        GDKfatal("yyextend: out of memory.\n");
                }
                buf[0] = yy_buf; 
-               yy_free = sizeof(char*); /* first bytes are the backpointer */
+               yy_free = sizeof(lng); /* first bytes are the backpointer,
+                                         to keep lngs etc aligned 
+                                         we skip a full sizeof(lng) */
                yy_buf = (char*) buf;
        }
        t = (YYSTREE) (yy_buf + yy_free);
@@ -164,6 +166,7 @@
        }
        t = (YYSTREE) ((*next)  - off);
         YYNODE(t, tok, TYPE_void, off, nbytes, cap, malloced, extendable);
+       nbytes = (nbytes+7)&~7; /* round up to be 8 bytes aligned */
        *next += nbytes - off;
        return t;
 }
@@ -352,14 +355,18 @@
        }
        yy_buf = (char*) cur;
        yy_free = yy_backup;
-       yy_backup = sizeof(char*);
+       yy_backup = sizeof(lng); /* first bytes are the backpointer,
+                                 to keep lngs etc aligned 
+                                 we skip a full sizeof(lng) */
        yy_sync = NULL;
 }
 
 void 
 Myylogclean(void)
 {
-       yy_backup = sizeof(char*);
+       yy_backup = sizeof(lng); /* first bytes are the backpointer,
+                                 to keep lngs etc aligned 
+                                 we skip a full sizeof(lng) */
        yy_sync = NULL;
        Myylogpop();
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to