Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5247/src/gdk
Modified Files:
Tag: GDK-2
gdk.mx gdk_align.mx gdk_bat.mx gdk_batop.mx gdk_storage.mx
Log Message:
fixed needed for getting xquery to work (a bit) again
restricted macro needs both parents now in case of a view
Index: gdk.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk.mx,v
retrieving revision 1.237.2.8
retrieving revision 1.237.2.9
diff -u -d -r1.237.2.8 -r1.237.2.9
--- gdk.mx 11 Aug 2007 22:25:22 -0000 1.237.2.8
+++ gdk.mx 14 Aug 2007 11:31:30 -0000 1.237.2.9
@@ -2779,7 +2779,10 @@
#define ALIGNinp(x,y,f) {if (!(f))
VIEWchk(x,y,BAT_READ|BAT_APPEND);(x)->talign=0; }
#define ALIGNapp(x,y,f) {if (!(f)) VIEWchk(x,y,BAT_READ);(x)->talign=0; }
-#define BATrestricted(b)
(VIEWhparent(b)?BBP_cache(VIEWhparent(b))->batRestricted:(b)->batRestricted)
+#define BATrestricted(b) \
+ (!isVIEW(b)?(b)->batRestricted: \
+ (VIEWhparent(b)?BBP_cache(VIEWhparent(b))->batRestricted:\
+ (VIEWtparent(b)?BBP_cache(VIEWtparent(b))->batRestricted:0)))
/* The batRestricted field indicates whether a BAT is readonly.
* we have modes: BAT_WRITE = all permitted
@@ -3052,25 +3055,25 @@
#define SORTfnd_oid(b,v) SORTfnd_int(b,v)
#define SORTfndfirst_oid(b,v) SORTfndfirst_int(b,v)
#define SORTfndlast_oid(b,v) SORTfndlast_int(b,v)
-#define SORTloop_oid(b,p,q,tl,th,s) SORTloop_int(b,p,q,tl,th,s)
+#define SORTloop_oid(b,p,q,tl,th) SORTloop_int(b,p,q,tl,th)
#else
#define SORTfnd_oid(b,v) SORTfnd_lng(b,v)
#define SORTfndfirst_oid(b,v) SORTfndfirst_lng(b,v)
#define SORTfndlast_oid(b,v) SORTfndlast_lng(b,v)
-#define SORTloop_oid(b,p,q,tl,th,s) SORTloop_lng(b,p,q,tl,th,s)
+#define SORTloop_oid(b,p,q,tl,th) SORTloop_lng(b,p,q,tl,th)
#endif
#if SIZEOF_WRD == SIZEOF_INT
#define SORTfnd_wrd(b,v) SORTfnd_int(b,v)
#define SORTfndfirst_wrd(b,v) SORTfndfirst_int(b,v)
#define SORTfndlast_wrd(b,v) SORTfndlast_int(b,v)
-#define SORTloop_wrd(b,p,q,tl,th,s) SORTloop_int(b,p,q,tl,th,s)
+#define SORTloop_wrd(b,p,q,tl,th) SORTloop_int(b,p,q,tl,th)
#else
#define SORTfnd_wrd(b,v) SORTfnd_lng(b,v)
#define SORTfndfirst_wrd(b,v) SORTfndfirst_lng(b,v)
#define SORTfndlast_wrd(b,v) SORTfndlast_lng(b,v)
-#define SORTloop_wrd(b,p,q,tl,th,s) SORTloop_lng(b,p,q,tl,th,s)
+#define SORTloop_wrd(b,p,q,tl,th) SORTloop_lng(b,p,q,tl,th)
#endif
-#define SORTloop_bit(b,p,q,tl,th,s) SORTloop_chr(b,p,q,tl,th,s)
+#define SORTloop_bit(b,p,q,tl,th) SORTloop_chr(b,p,q,tl,th)
@
@+ Common BAT Operations
Index: gdk_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_storage.mx,v
retrieving revision 1.128.2.4
retrieving revision 1.128.2.5
diff -u -d -r1.128.2.4 -r1.128.2.5
--- gdk_storage.mx 10 Aug 2007 15:31:46 -0000 1.128.2.4
+++ gdk_storage.mx 14 Aug 2007 11:31:42 -0000 1.128.2.5
@@ -460,7 +460,7 @@
img->theap->storage = GDK_ELIMDOUBLES(img->theap) ? STORE_MEM :
b->batMaptheap;
}
- /* change modes in img into legal modes, and reset b's mapdity if
something had to be corrected */
+ /* change modes in img into legal modes, and reset b's mapdirty if
something had to be corrected */
b->batMapdirty |= BATcheckmodes(img, BBP_status(b->batCacheid) &
BBPEXISTING, FALSE);
}
@@ -475,7 +475,6 @@
b->theapdirty = 0;
}
-
BAT *
BATsave(BAT *bd)
{
@@ -515,15 +514,6 @@
b->H = &bs.H;
b->T = &bs.T;
- if (b->hheap) {
- b->hheap = (Heap *) GDKmalloc(sizeof(Heap));
- *b->hheap = *bd->hheap;
- }
- if (b->theap) {
- b->theap = (Heap *) GDKmalloc(sizeof(Heap));
- *b->theap = *bd->theap;
- }
-
/* start saving data */
nme = BBP_physical(b->batCacheid);
if (b->batCopiedtodisk == 0 || b->batDirty || b->batDirtybuns) {
@@ -553,11 +543,6 @@
IODEBUG THRprintf(GDKout, "#BATsavedesc(%s,free=" SZFMT
"," SZFMT ") = %d\n", nme, b->H->heap.free, b->T->heap.free, err);
}
- if (b->hheap)
- GDKfree(b->hheap);
- if (b->theap)
- GDKfree(b->theap);
-
if (err == 0) {
bd->batCopiedtodisk = 1;
DESCclean(bd);
Index: gdk_align.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_align.mx,v
retrieving revision 1.83.4.7
retrieving revision 1.83.4.8
diff -u -d -r1.83.4.7 -r1.83.4.8
--- gdk_align.mx 12 Aug 2007 08:27:10 -0000 1.83.4.7
+++ gdk_align.mx 14 Aug 2007 11:31:32 -0000 1.83.4.8
@@ -342,7 +342,7 @@
if (bn == NULL || bm == NULL)
return NULL;
- bn->T = &bs->T;
+ bm->H = bn->T = &bs->T;
bn->T->dim.type = TYPE_void;
bn->T->dim.varsized = 1;
bn->T->dim.shift = 0;
Index: gdk_batop.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_batop.mx,v
retrieving revision 1.138.4.8
retrieving revision 1.138.4.9
diff -u -d -r1.138.4.8 -r1.138.4.9
--- gdk_batop.mx 13 Aug 2007 23:36:56 -0000 1.138.4.8
+++ gdk_batop.mx 14 Aug 2007 11:31:39 -0000 1.138.4.9
@@ -1665,7 +1665,7 @@
ts = (size_t) Tsize(b);
h = (char *) GDKmalloc(hs);
t = (char *) GDKmalloc(ts);
- for (p = BUNlast(b) - 1, q = BUNfirst(b); p > q; p--, q++) {
+ for (p = BUNlast(b)?BUNlast(b) - 1:0, q = BUNfirst(b); p > q; p--, q++){
char *ph = BUNhloc(bi,p);
char *qh = BUNhloc(bi,q);
char *pt = BUNtloc(bi,p);
Index: gdk_bat.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_bat.mx,v
retrieving revision 1.181.4.7
retrieving revision 1.181.4.8
diff -u -d -r1.181.4.7 -r1.181.4.8
--- gdk_bat.mx 11 Aug 2007 22:25:25 -0000 1.181.4.7
+++ gdk_bat.mx 14 Aug 2007 11:31:35 -0000 1.181.4.8
@@ -343,9 +343,7 @@
BATextend(BAT *b, size_t newcap)
{
size_t hheap_size, theap_size;
- int ret;
- assert(b->htype || b->ttype);
BATcheck(b, "BATextend");
@-
The main issue is to properly predict the new BAT size.
@@ -356,18 +354,17 @@
value, otherwise you may easily corrupt the administration of
malloc.
@c
- if (newcap <= BATbuncount(b)) {
+ if (newcap <= BATcapacity(b)) {
return b;
}
- hheap_size = Hsize(b) * newcap;
- theap_size = Tsize(b) * newcap;
b->batCapacity = newcap;
- ret = HEAPextend(&b->H->heap, hheap_size);
- if (ret < 0)
+
+ hheap_size = Hsize(b) * newcap;
+ if (b->H->heap.base && HEAPextend(&b->H->heap, hheap_size) < 0)
return NULL;
- ret = HEAPextend(&b->T->heap, theap_size);
- if (ret < 0)
+ theap_size = Tsize(b) * newcap;
+ if (b->T->heap.base && HEAPextend(&b->T->heap, theap_size) < 0)
return NULL;
HASHdestroy(b);
return b;
-------------------------------------------------------------------------
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