Update of /cvsroot/monetdb/MonetDB5/src/modules/kernel
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1480/src/modules/kernel
Modified Files:
Tag: GDK-2
bat5.mx
Log Message:
Got rid of macro batLview (just be explicit).
Split BATrestricted into BAThrestricted and BATtrestricted (since
columns can come from different parents).
parentid now always refers to the BAT whose head column the relevant
column is a view on. In other words, it can be negative which means
that the view is on the head of the reverse(), or the tail of the
original. In yet other words, the view is always based on the head of
BBP_cache(...->parentid).
Fixed various issues rising from these changes.
Typo: writeable -> writable.
Approved availability test.
Index: bat5.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/kernel/bat5.mx,v
retrieving revision 1.20.4.4
retrieving revision 1.20.4.5
diff -u -d -r1.20.4.4 -r1.20.4.5
--- bat5.mx 15 Aug 2007 09:37:46 -0000 1.20.4.4
+++ bat5.mx 17 Aug 2007 08:51:00 -0000 1.20.4.5
@@ -1945,7 +1945,6 @@
BATseqbase(BATmirror(bn), mpid << REMAP_PAGE_BITS);
}
BATsetcount(bn,cnt <<= REMAP_PAGE_BITS);
- bn->T->heap.free = tailsize(bn,cnt);
return GDK_SUCCEED;
}
@@ -1994,8 +1993,7 @@
bn->tsorted = 0;
bn->tkey = 0;
bn->batRestricted = BAT_READ;
- BATsetcount(bn, n = (cnt << REMAP_PAGE_BITS));
- n = tailsize(b,n);
+ n = cnt << REMAP_PAGE_BITS;
/* copy the entire tail heap (if present) */
if (ATOMvarsized(bn->ttype)) {
@@ -2008,26 +2006,29 @@
/* try to get a reserved mmap region */
if (mmappath) {
void *base;
+ size_t heapsize = tailsize(bn, n);
+
if (bn->T->heap.filename)
GDKfree(bn->T->heap.filename);
bn->T->heap.filename = GDKstrdup(b->T->heap.filename);
if (bn->T->heap.filename == NULL)
goto error;
GDKfilepath(mmappath, BATDIR, bn->T->heap.filename, NULL);
- base = MT_mmap_open(&hdl, mmappath, mode, 0, n, cnt);
+ base = MT_mmap_open(&hdl, mmappath, mode, 0, heapsize, cnt);
if (base == (void*) -1) goto error;
bn->T->heap.base = base;
- bn->T->heap.size = bn->T->heap.maxsize = n;
+ bn->T->heap.size = bn->T->heap.maxsize = heapsize;
bn->T->heap.storage = STORE_MMAP;
if (!*force)
bn->T->heap.storage |= STORE_PRIV;
- } else if (HEAPalloc(&bn->T->heap, n, 1) < 0) {
+ } else if (HEAPalloc(&bn->T->heap, n, Tsize(bn)) < 0) {
goto error;
}
/* set the right bat size */
- bn->T->heap.free = n;
+ bn->batCapacity = n;
+ BATsetcount(bn, n);
bn->batFirst = bn->batDeleted = 0;
bn->batInserted = (cnt << REMAP_PAGE_BITS);
@@ -2045,7 +2046,7 @@
}
if (mmappath) {
MT_mmap_close(&hdl);
- GDKvminc(n);
+ GDKvminc(tailsize(bn, n));
}
/* if the tail atom has refcounting, we must fix the copies */
@@ -2057,10 +2058,12 @@
BBPcacheit(bn);
if (mmappath) {
/* if copy-on-write was used, make bn a logical view on b */
- bn->batLview = TRUE;
+ bn->P->lview = TRUE;
bn->T->heap.copied = TRUE;
- BBPshare(bn->H->parentid = b->batCacheid);
- BBPshare(bn->T->parentid = b->batCacheid);
+ if (bn->H->type != TYPE_void)
+ BBPshare(bn->H->parentid = b->batCacheid);
+ if (bn->T->type != TYPE_void)
+ BBPshare(bn->T->parentid = -b->batCacheid);
}
return GDK_SUCCEED;
error:
@@ -2166,8 +2169,6 @@
bni = bat_iterator(bn);
if (bn == NULL) return GDK_FAIL;
BATsetcount(bn, n);
- bn->H->heap.free = headsize(bn,n);
- bn->T->heap.free = tailsize(bn,n);
BATseqbase(bn, b->hseqbase);
/* do the work in a fast function */
-------------------------------------------------------------------------
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