Changeset: ba323345dd9e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ba323345dd9e
Modified Files:
MonetDB/src/gdk/gdk.mx
MonetDB/src/gdk/gdk_bat.mx
MonetDB/src/gdk/gdk_batop.mx
MonetDB/src/gdk/gdk_bbp.mx
MonetDB/src/gdk/gdk_delta.mx
MonetDB/src/gdk/gdk_relop.mx
MonetDB/src/gdk/gdk_scanselect.mx
MonetDB/src/gdk/gdk_storage.mx
MonetDB4/src/modules/contrib/malalgebra.mx
MonetDB4/src/modules/plain/aggr.mx
MonetDB4/src/modules/plain/aggrX3_be_minmax.mx
MonetDB4/src/modules/plain/aggrX3_bge_minmax.mx
MonetDB4/src/modules/plain/algebra.mx
MonetDB4/src/modules/plain/bat.mx
MonetDB4/src/modules/plain/decimal.mx
MonetDB4/src/modules/plain/enum.mx
MonetDB4/src/modules/plain/radix.mx
MonetDB4/src/modules/plain/sys.mx
MonetDB4/src/modules/plain/tcpip.mx
MonetDB4/src/modules/plain/xtables.mx
MonetDB4/src/monet/monet_multiplex.mx
MonetDB5/src/mal/mal_profiler.mx
MonetDB5/src/modules/kernel/aggr_be_minmax.mx
MonetDB5/src/modules/kernel/aggr_bge_minmax.mx
MonetDB5/src/modules/kernel/algebra.mx
MonetDB5/src/modules/kernel/algebra2.mx
MonetDB5/src/modules/kernel/bat5.mx
MonetDB5/src/modules/kernel/group.mx
MonetDB5/src/modules/mal/crackers/crackers_joins.mx
MonetDB5/src/modules/mal/crackers/crackers_sortmerge.mx
MonetDB5/src/modules/mal/radix.mx
MonetDB5/src/modules/mal/urlbox.mx
pathfinder/runtime/shredder.mx
pathfinder/runtime/xrpc_common.mx
Branch: Jun2010
Log Message:
Cleanup: replace all occurrences of hheap and theap with H->vheap and T->vheap.
diffs (truncated from 1624 to 300 lines):
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk.mx
--- a/MonetDB/src/gdk/gdk.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk.mx Mon Jun 07 09:42:27 2010 +0200
@@ -1012,8 +1012,6 @@
#define tsorted T->sorted
#define hdense H->dense
#define tdense T->dense
-#define hheap H->vheap
-#define theap T->vheap
#define hident H->id
#define tident T->id
#define halign H->align
@@ -3209,7 +3207,7 @@
If so, we can just compare integer index numbers instead of strings:
@h
#define HASHloop_fstr(bi, h, hb, idx, v) \
- for (hb = h->hash[strHash(v)&h->mask], idx =
strLocate((bi.b)->hheap,v); \
+ for (hb = h->hash[strHash(v)&h->mask], idx =
strLocate((bi.b)->H->vheap,v); \
hb != BUN_NONE; hb = h->link[hb]) \
if (VarHeapValRaw((bi).b->H->heap.base, hb, (bi).b->H->width)
== idx)
@
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_bat.mx
--- a/MonetDB/src/gdk/gdk_bat.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_bat.mx Mon Jun 07 09:42:27 2010 +0200
@@ -1959,7 +1959,7 @@
}
@= dohash
- ATOMstorage(@1->@2type) != TYPE_chr && (ATOMstorage(@1->@2type) !=
TYPE_str || !GDK_ELIMDOUBLES(@1->@2heap))
+ ATOMstorage(@1->@2->type) != TYPE_chr && (ATOMstorage(@1->@2->type) !=
TYPE_str || !GDK_ELIMDOUBLES(@1->@2->vheap))
@c
BUN
BUNlocate(BAT *b, ptr x, ptr y)
@@ -2034,16 +2034,16 @@
/* regrettably MonetDB support only single-column hashes
* strategy: create a hash on both columns, and select the
column with the best distribution
*/
- if ((b->T->hash && b->H->hash == NULL) || !(@:dohash(b,h)@))
+ if ((b->T->hash && b->H->hash == NULL) || !(@:dohash(b,H)@))
@:swap()@
if (b->H->hash == NULL && (v = VIEWcreate_(b, b, TRUE)) !=
NULL) {
/* As we are going to remove the worst hash table
later, we must do everything
* in a view, as it is not permitted to remove a hash
table from a read-only
* operation (like BUNlocate). Other threads might then
crash.
*/
- if (@:dohash(v,h)@)
+ if (@:dohash(v,H)@)
(void) BATprepareHash(v);
- if (@:dohash(v,t)@)
+ if (@:dohash(v,T)@)
(void) BATprepareHash(BATmirror(v));
if (v->H->hash && v->T->hash) { /* we can choose
between two hash tables */
BUN hcnt = 0, tcnt = 0;
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_batop.mx
--- a/MonetDB/src/gdk/gdk_batop.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_batop.mx Mon Jun 07 09:42:27 2010 +0200
@@ -906,7 +906,7 @@
q++;
}
@= stringselect
- if (strElimDoubles(b->hheap)) {
+ if (strElimDoubles(b->H->vheap)) {
BUN p;
size_t j;
@@ -1840,7 +1840,7 @@
@:chk_order(dbl,@3,@5)@
} else {
/* check sortedness tuple-by-tuple */
- if (b->hheap) {
+ if (b->H->vheap) {
char *base = Hbase(b);
char *prv = base + BUNhvaroff(bi, cur);
@@ -1999,7 +1999,7 @@
b = BATrevert(b);
return b;
}
- g...@7sort@3(Hloc(b,BUNfirst(b)), Tloc(b,BUNfirst(b)),
(b->hheap)?b->H->vheap->base:NULL, BATcount(b), Hsize(b), Tsize(b), b->htype);
+ g...@7sort@3(Hloc(b,BUNfirst(b)), Tloc(b,BUNfirst(b)),
(b->H->vheap)?b->H->vheap->base:NULL, BATcount(b), Hsize(b), Tsize(b),
b->htype);
HASHdestroy(b);
ALIGNdel(b, "bator...@3", FALSE);
b->hsorted = (bit) gdk_sor...@2;
@@ -3054,7 +3054,7 @@
BATcheck(b, "BAThistogram");
- tricky = (b->ttype == TYPE_str && strElimDoubles(b->theap));
+ tricky = (b->ttype == TYPE_str && strElimDoubles(b->T->vheap));
if (b->talign == 0) {
b->talign = OIDnew(1);
}
@@ -3069,8 +3069,8 @@
by bulk copying the heap as well
@c
if (tricky) {
- bn->hheap = (Heap *) GDKzalloc(sizeof(Heap));
- if (bn->hheap && b->T->vheap->filename) {
+ bn->H->vheap = (Heap *) GDKzalloc(sizeof(Heap));
+ if (bn->H->vheap && b->T->vheap->filename) {
char *nme = BBP_physical(bn->batCacheid);
bn->H->vheap->filename = (str) GDKmalloc(strlen(nme) +
12);
@@ -3078,7 +3078,7 @@
goto bunins_failed;
GDKfilepath(bn->H->vheap->filename, NULL, nme, "hheap");
}
- if (HEAPcopy(bn->hheap, b->theap) < 0)
+ if (HEAPcopy(bn->H->vheap, b->T->vheap) < 0)
goto bunins_failed;
bn->htype = b->ttype;
bn->hvarsized = 1;
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_bbp.mx
--- a/MonetDB/src/gdk/gdk_bbp.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_bbp.mx Mon Jun 07 09:42:27 2010 +0200
@@ -3857,10 +3857,10 @@
delete = (b == NULL || !b->ttype || b->batCopiedtodisk
== 0);
} else if (strncmp(p + 1, "hheap", 5) == 0) {
BAT *b = getdesc(bid);
- delete = (b == NULL || !b->hheap || b->batCopiedtodisk
== 0);
+ delete = (b == NULL || !b->H->vheap ||
b->batCopiedtodisk == 0);
} else if (strncmp(p + 1, "theap", 5) == 0) {
BAT *b = getdesc(bid);
- delete = (b == NULL || !b->theap || b->batCopiedtodisk
== 0);
+ delete = (b == NULL || !b->T->vheap ||
b->batCopiedtodisk == 0);
} else if (strncmp(p + 1, "hhash", 5) == 0) {
BAT *b = getdesc(bid);
delete = (b == NULL || !b->H->hash);
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_delta.mx
--- a/MonetDB/src/gdk/gdk_delta.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_delta.mx Mon Jun 07 09:42:27 2010 +0200
@@ -122,13 +122,13 @@
(*hunfix) (h);
}
if (hatmdel) {
- (*hatmdel) (b->hheap, (var_t *)
BUNhloc(bi, p));
+ (*hatmdel) (b->H->vheap, (var_t *)
BUNhloc(bi, p));
}
if (tunfix) {
(*tunfix) (t);
}
if (tatmdel) {
- (*tatmdel) (b->theap, (var_t *)
BUNtloc(bi, p));
+ (*tatmdel) (b->T->vheap, (var_t *)
BUNtloc(bi, p));
}
}
}
@@ -221,7 +221,7 @@
(*hunfix) (h);
}
if (hatmdel) {
- (*hatmdel) (b->hheap, (var_t *)
BUNhloc(bi, p));
+ (*hatmdel) (b->H->vheap, (var_t *)
BUNhloc(bi, p));
}
if (b->T->hash) {
HASHdel(b->T->hash, i, t, p < bunlast);
@@ -230,7 +230,7 @@
(*tunfix) (t);
}
if (tatmdel) {
- (*tatmdel) (b->theap, (var_t *)
BUNtloc(bi, p));
+ (*tatmdel) (b->T->vheap, (var_t *)
BUNtloc(bi, p));
}
}
}
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_relop.mx
--- a/MonetDB/src/gdk/gdk_relop.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_relop.mx Mon Jun 07 09:42:27 2010 +0200
@@ -557,9 +557,9 @@
The aftermath -- property setting -- is relatively straightforward here.
@{
@c
-#define HLATOMput(bn, dst) ATOMput(bn->htype, bn->hheap, dst,
BUNhloc(li,l_cur))
+#define HLATOMput(bn, dst) ATOMput(bn->htype, bn->H->vheap, dst,
BUNhloc(li,l_cur))
#define HVATOMput(bn, dst) Hputvalue(bn, dst, BUNhvar(li,l_cur), 1)
-#define TLATOMput(bn, dst) ATOMput(bn->ttype, bn->theap, dst,
BUNtloc(ri,r_cur))
+#define TLATOMput(bn, dst) ATOMput(bn->ttype, bn->T->vheap, dst,
BUNtloc(ri,r_cur))
#define TVATOMput(bn, dst) Tputvalue(bn, dst, BUNtvar(ri,r_cur), 1)
@= SIMPLEput
@@ -1049,17 +1049,17 @@
*bn->T->vheap = *r->T->vheap;
bn->T->vheap->parentid = parent;
} else {
- if (bn->theap && r->theap->filename) {
+ if (bn->T->vheap && r->T->vheap->filename) {
char *nme =
BBP_physical(bn->batCacheid);
- bn->theap->filename = (str)
GDKmalloc(strlen(nme) + 12);
- if (bn->theap->filename == NULL) {
+ bn->T->vheap->filename = (str)
GDKmalloc(strlen(nme) + 12);
+ if (bn->T->vheap->filename == NULL) {
BBPreclaim(bn);
goto ready;
}
- GDKfilepath(bn->theap->filename, NULL,
nme, "theap");
+ GDKfilepath(bn->T->vheap->filename,
NULL, nme, "theap");
}
- if (HEAPcopy(bn->theap, r->theap) < 0) {
+ if (HEAPcopy(bn->T->vheap, r->T->vheap) < 0) {
BBPreclaim(bn);
goto ready;
}
@@ -1079,7 +1079,7 @@
ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: BAThvoid(l) &&
!BATtvoid(l)\n");
if (ATOMstorage(tpe) == TYPE_str && estimate >
batcache_maxbuckets * BATTINY &&
- /* GDK_ELIMDOUBLES(r->theap) && */
+ /* GDK_ELIMDOUBLES(r->T->vheap) && */
(!rcount || (lcount << 3) > rcount)) {
/* insert double-eliminated strings as ints */
tpe = r->T->width == 1 ? TYPE_bte : (r->T->width == 2 ?
TYPE_sht : (r->T->width == 4 ? TYPE_int : TYPE_lng));
@@ -1120,19 +1120,19 @@
}
/* handle string trick */
if (tpe != r->ttype && ATOMstorage(r->ttype) == TYPE_str) {
- bn->theap = (Heap *) GDKzalloc(sizeof(Heap));
- if (bn->theap && r->theap->filename) {
+ bn->T->vheap = (Heap *) GDKzalloc(sizeof(Heap));
+ if (bn->T->vheap && r->T->vheap->filename) {
char *nme = BBP_physical(bn->batCacheid);
- bn->theap->filename = (str)
GDKmalloc(strlen(nme) + 12);
- if (bn->theap->filename == NULL) {
+ bn->T->vheap->filename = (str)
GDKmalloc(strlen(nme) + 12);
+ if (bn->T->vheap->filename == NULL) {
BBPreclaim(bn);
ret = NULL;
goto ready;
}
- GDKfilepath(bn->theap->filename, NULL, nme,
"theap");
+ GDKfilepath(bn->T->vheap->filename, NULL, nme,
"theap");
}
- if (HEAPcopy(bn->theap, r->theap) < 0) {
+ if (HEAPcopy(bn->T->vheap, r->T->vheap) < 0) {
BBPreclaim(bn);
ret = NULL;
goto ready;
@@ -1252,8 +1252,8 @@
@-
collect statistics that help us decide what to do
@c
- lsize = lcount * (Hsize(l) + Tsize(l)) + (l->hheap ? l->hheap->size :
0) + (l->theap ? l->theap->size : 0) + 2 * lcount * sizeof(BUN);
- rsize = rcount * (Hsize(r) + Tsize(r)) + (r->hheap ? r->hheap->size :
0) + (r->theap ? r->theap->size : 0) + 2 * rcount * sizeof(BUN);
+ lsize = lcount * (Hsize(l) + Tsize(l)) + (l->H->vheap ?
l->H->vheap->size : 0) + (l->T->vheap ? l->T->vheap->size : 0) + 2 * lcount *
sizeof(BUN);
+ rsize = rcount * (Hsize(r) + Tsize(r)) + (r->H->vheap ?
r->H->vheap->size : 0) + (r->T->vheap ? r->T->vheap->size : 0) + 2 * rcount *
sizeof(BUN);
for (logr = 4, i = rcount; i > 0; logr++)
i >>= 1;
for (logl = 4, i = lcount; i > 0; logl++)
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_scanselect.mx
--- a/MonetDB/src/gdk/gdk_scanselect.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_scanselect.mx Mon Jun 07 09:42:27 2010 +0200
@@ -575,13 +575,13 @@
#endif /* NOEXPAND_LNG */
#endif /* SKIP_TYPE_EXPANSIONS */
if (b->tvarsized) {
- if (equi && t == TYPE_str && strElimDoubles(b->theap)) {
+ if (equi && t == TYPE_str && strElimDoubles(b->T->vheap)) {
/* Single-valued sequential scans for strings are
* optimized when double elemination is in effect,
* by scanning for the correct integer index value.
* This is an equi select, so we assemble the
* predicate here and skip seqscanIF. */
- str_idx = strLocate(b->theap, tl);
+ str_idx = strLocate(b->T->vheap, tl);
if (b->T->width <= 2)
str_idx -= GDK_VAROFFSET;
@:seqscanHTget(eq_str,var,tloc,if((b->T->width==1?(var_t)*(unsigned
char*)v:(b->T->width==2?(var_t)*(unsigned
short*)v:(b->T->width==4?(var_t)*(unsigned int*)v:*(var_t*)v)))==str_idx),tl)@
diff -r 2620ee703b85 -r ba323345dd9e MonetDB/src/gdk/gdk_storage.mx
--- a/MonetDB/src/gdk/gdk_storage.mx Sun Jun 06 21:32:06 2010 +0200
+++ b/MonetDB/src/gdk/gdk_storage.mx Mon Jun 07 09:42:27 2010 +0200
@@ -459,13 +459,13 @@
ret |= b->T->heap.newstorage != m || b->T->heap.storage != m;
b->T->heap.newstorage = b->T->heap.storage = m;
}
- if (b->hheap && b->batMaphheap) {
+ if (b->H->vheap && b->batMaphheap) {
int hrestrict = (b->batRestricted == BAT_APPEND) &&
ATOMappendpriv(b->htype, b->H->vheap);
int m = STORE_MODE(b->batMaphheap, brestrict || hrestrict,
existing);
ret |= b->H->vheap->newstorage != m || b->H->vheap->storage !=
m;
b->H->vheap->newstorage = b->H->vheap->storage = m;
}
- if (b->theap && b->batMaptheap) {
+ if (b->T->vheap && b->batMaptheap) {
int trestrict = (b->batRestricted == BAT_APPEND) &&
ATOMappendpriv(b->ttype, b->T->vheap);
int m = STORE_MODE(b->batMaptheap, brestrict || trestrict,
existing);
ret |= b->T->vheap->newstorage != m || b->T->vheap->storage !=
m;
@@ -531,20 +531,20 @@
b->H = &bs.H;
b->T = &bs.T;
- if (b->hheap) {
- b->hheap = (Heap *) GDKmalloc(sizeof(Heap));
- if (b->hheap == NULL)
+ if (b->H->vheap) {
+ b->H->vheap = (Heap *) GDKmalloc(sizeof(Heap));
+ if (b->H->vheap == NULL)
return NULL;
- *b->hheap = *bd->hheap;
+ *b->H->vheap = *bd->H->vheap;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list