Changeset: a2d13b52608d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2d13b52608d
Modified Files:
gdk/gdk.h
gdk/gdk_batop.c
gdk/gdk_col.c
gdk/gdk_delta.h
Branch: headless
Log Message:
Renamed size() to COLwidth() and base() to COLbase().
diffs (248 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1287,9 +1287,9 @@
#define COLtype(b) ((b)->type == TYPE_void && (b)->seqbase == oid_nil ?\
TYPE_void : ATOMtype((b)->type))
#define COLstore(b) (COLdense(b) ? TYPE_void : (b)->type)
-#define base(b) ((b)->vheap->base)
+#define COLbase(b) ((b)->vheap->base)
-#define size(b) ((b)->width)
+#define COLwidth(b) ((b)->width)
/* new semantics ! */
#define headsize(b,p) ((b)->type?((size_t)(p))<<(b)->shift:0)
@@ -1345,7 +1345,7 @@
#define BUNloc(bi,p) COLelement((bi).b,p)
#define BUNpos(bi,p) ((bi).vid = (bi).b->seqbase + ((bi).b->seqbase ==
oid_nil ? 0 : (p) - (bi).b->first), (char *) &(bi).vid)
-#define BUNvar(bi,p)
((bi).b->type?(base((bi).b)+BUNvaroff(bi,p)):BUNpos(bi,p))
+#define BUNvar(bi,p)
((bi).b->type?(COLbase((bi).b)+BUNvaroff(bi,p)):BUNpos(bi,p))
#define BUNhead(bi,p) ((bi).b->varsized?BUNvar(bi,p):BUNloc(bi,p))
static inline COLiter
@@ -2880,7 +2880,7 @@
for(q = BUNlast(r), p = BUNfirst(r);p < q; p++)
#define COLforloop(b,o) for( o = 0; o < b->count; o++)
-#define COLgetString(b,o) (str)(base(b) + ((size_t)
VarHeapValRaw(b,o,b->width) << GDK_VARSHIFT))
+#define COLgetString(b,o) (str)(COLbase(b) + ((size_t)
VarHeapValRaw(b,o,b->width) << GDK_VARSHIFT))
gdk_export str COLputString(COL *b, oid o, str v);
/*
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -307,7 +307,7 @@
COLiter ni = col_iterator(n);
COLloop(n, p, q) {
- bunfastins_nocheck(b, r, BUNhead(ni, p), 0,
size(b));
+ bunfastins_nocheck(b, r, BUNhead(ni, p), 0,
COLwidth(b));
r++;
}
}
@@ -515,7 +515,7 @@
#define hashselect_loop(TYPE) \
HASHloop_typed(bi, b->hash, i, tl, TYPE) { \
if (q < r) { \
- bunfastins_nocheck(bn, q, &i, size(bn)); \
+ bunfastins_nocheck(bn, q, &i, COLwidth(bn)); \
if (q > 0 && * (oid *) COLelement(nb,q-1) < i) \
bn->sorted = 0; \
} \
@@ -566,7 +566,7 @@
HASHloop_fstr(bi, b->hash, p, j, tl) {
if (q < r) {
- bunfastins_nocheck(bn, q, &i,
size(bn));
+ bunfastins_nocheck(bn, q, &i,
COLwidth(bn));
if (q > 0 && * (oid *)
COLelement(nb,q-1) < i)
bn->sorted = 0;
}
@@ -577,7 +577,7 @@
HASHloop_str(bi, b->hash, p, tl) {
if (q < r) {
- bunfastins_nocheck(bn, q, &i,
size(bn));
+ bunfastins_nocheck(bn, q, &i,
COLwidth(bn));
if (q > 0 && * (oid *)
COLelement(nb,q-1) < i)
bn->sorted = 0;
}
@@ -590,7 +590,7 @@
if (b->varsized) {
HASHloopvar(bi, b->hash, i, tl) {
if (q < r) {
- bunfastins_nocheck(bn, q, &i,
size(bn));
+ bunfastins_nocheck(bn, q, &i,
COLwidth(bn));
if (q > 0 && * (oid *)
COLelement(nb,q-1) < i)
bn->sorted = 0;
}
@@ -599,7 +599,7 @@
} else {
HASHlooploc(bi, b->hash, i, tl) {
if (q < r) {
- bunfastins_nocheck(bn, q, &i,
size(bn));
+ bunfastins_nocheck(bn, q, &i,
COLwidth(bn));
if (q > 0 && * (oid *)
COLelement(nb,q-1) < i)
bn->sorted = 0;
}
@@ -1204,7 +1204,7 @@
o ? COLelement(o, BUNfirst(o)) : NULL,
b->vheap ? b->vheap->base : NULL,
COLcount(b),
- size(b),
+ COLwidth(b),
b->type) < 0)
return NULL;
} else {
@@ -1212,7 +1212,7 @@
o ? COLelement(o, BUNfirst(o)) : NULL,
b->vheap ? b->vheap->base : NULL,
COLcount(b),
- size(b),
+ COLwidth(b),
b->type) < 0)
return NULL;
}
@@ -1222,14 +1222,14 @@
o ? COLelement(o, BUNfirst(o)) : NULL,
b->vheap ? b->vheap->base : NULL,
COLcount(b),
- size(b),
+ COLwidth(b),
b->type);
else
GDKqsort(COLelement(b, BUNfirst(b)),
o ? COLelement(o, BUNfirst(o)) : NULL,
b->vheap ? b->vheap->base : NULL,
COLcount(b),
- size(b),
+ COLwidth(b),
b->type);
}
HASHdestroy(b);
@@ -1377,7 +1377,7 @@
return NULL;
}
ALIGNdel(b, "COLrevert", FALSE);
- s = size(b);
+ s = COLwidth(b);
if (s > 0) {
h = (char *) GDKmalloc(s);
if (!h) {
@@ -1422,7 +1422,7 @@
ALIGNset(bn, b);
COLloop(b, p, q) {
- bunfastins_nocheck(bn, r, (ptr) &start, size(bn));
+ bunfastins_nocheck(bn, r, (ptr) &start, COLwidth(bn));
r++;
if (i == grpsize - 1) {
start += incr;
@@ -2008,7 +2008,7 @@
if (COLatoms[tpe].atomFix || COLatoms[tpe].atomPut) {
for (r = BUNfirst(bn), cnt += r; r < cnt; r++)
- bunfastins_nocheck(bn, r, v, size(bn));
+ bunfastins_nocheck(bn, r, v, COLwidth(bn));
} else {
switch (ATOMsize(ATOMstorage(tpe))) {
case 1:{
@@ -2041,7 +2041,7 @@
}
default:
for (r = BUNfirst(bn), cnt += r; r < cnt; r++)
- bunfastins_nocheck(bn, r, v, size(bn));
+ bunfastins_nocheck(bn, r, v, COLwidth(bn));
}
}
bn->sorted = GDK_SORTED;
@@ -2056,7 +2056,7 @@
/*
* @+ COL Aggregates
*
- * We retain the size() and card() aggregate results in the column
+ * We retain the COLwidth() and card() aggregate results in the column
* descriptor. We would like to have such functionality in an
* extensible way for many aggregates, for DD (1) we do not want to
* change the binary COL format on disk and (2) aggr and size are the
diff --git a/gdk/gdk_col.c b/gdk/gdk_col.c
--- a/gdk/gdk_col.c
+++ b/gdk/gdk_col.c
@@ -166,7 +166,7 @@
b->width = 1;
else
b->width = ATOMsize(b->type);
- b->shift = ATOMelmshift(size(b));
+ b->shift = ATOMelmshift(COLwidth(b));
assert_shift_width(b->shift, b->width);
b->varsized = COLatoms[b->type].varsized;
}
@@ -407,7 +407,7 @@
b->capacity = newcap;
- heap_size *= size(b);
+ heap_size *= COLwidth(b);
if (b->heap.base && GDKdebug & EXTENDMASK)
fprintf(stderr, "#HEAPextend in COLextend %s " SZFMT " " SZFMT
"\n", b->heap.filename, b->heap.size, heap_size);
if (b->heap.base && HEAPextend(&b->heap, heap_size) < 0)
@@ -765,7 +765,7 @@
COLloop(b, p, q) {
ptr h = BUNhead(bi, p);
- bunfastins_nocheck(bn, r, h, size(bn));
+ bunfastins_nocheck(bn, r, h, COLwidth(bn));
r++;
}
} else if (ht && b->type == TYPE_void) {
@@ -786,7 +786,7 @@
char *cur = COLelement(b, p);
char *d = COLelement(bn, 0);
- bn->heap.free = bunstocopy * size(bn);
+ bn->heap.free = bunstocopy * COLwidth(bn);
if (tpe == TYPE_chr || tpe == TYPE_bte) {
bte *src = (bte *) cur, *dst = (bte *) d;
@@ -1101,7 +1101,7 @@
b->seqbase++;
}
} else {
- unsigned short hs = size(b);
+ unsigned short hs = COLwidth(b);
char *htmp = alloca(hs);
l = BUNfirst(b);
@@ -1150,7 +1150,7 @@
hashdel(b->hash, p, BUNhead(bi, p), p < last);
}
if (p != last) {
- unsigned short hs = size(b);
+ unsigned short hs = COLwidth(b);
char *htmp = alloca(hs);
COLiter bi2 = col_iterator(b);
@@ -1189,7 +1189,7 @@
}
}
}
- b->heap.free -= size(b);
+ b->heap.free -= COLwidth(b);
p--;
}
b->count--;
diff --git a/gdk/gdk_delta.h b/gdk/gdk_delta.h
--- a/gdk/gdk_delta.h
+++ b/gdk/gdk_delta.h
@@ -33,7 +33,7 @@
COLsetcount((P1), 0); \
(P1)->heap.free = 0; \
(P1)->deleted = (P1)->inserted = (P1)->first = 0; \
- (P1)->shift = ATOMelmshift(size(P1)); \
+ (P1)->shift = ATOMelmshift(COLwidth(P1));
\
DELTAprintf( \
"#DELTAinit %s free " SZFMT " ins " OIDFMT " del "
OIDFMT " first " OIDFMT " base " PTRFMT "\n", \
COLgetId(P1), \
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list