Changeset: 9d4d70910740 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9d4d70910740
Modified Files:
gdk/gdk.h
gdk/gdk_analytic_func.c
gdk/gdk_atoms.h
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_bbp.c
gdk/gdk_calc.c
gdk/gdk_calc_compare.h
gdk/gdk_hash.c
gdk/gdk_heap.c
gdk/gdk_private.h
gdk/gdk_qsort.c
gdk/gdk_search.c
gdk/gdk_ssort_impl.h
gdk/gdk_subquery.c
gdk/gdk_unique.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/manifold.c
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
monetdb5/modules/mal/txtsim.c
monetdb5/optimizer/opt_mitosis.c
sql/backends/monet5/dict.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_statistics.c
Branch: nested
Log Message:
Changed atom width from 16 bit unsigned to 32 bit unsigned.
diffs (truncated from 627 to 300 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -391,7 +391,7 @@ typedef struct BAT {
BUN batCapacity; /* tuple capacity */
/* dynamic column properties */
- uint16_t twidth; /* byte-width of the atom array */
+ uint32_t twidth; /* byte-width of the atom array */
int8_t ttype; /* type id. */
uint8_t tshift; /* log2 of bun width */
/* see also comment near BATassertProps() for more information
@@ -597,7 +597,7 @@ typedef struct BATiter {
BUN nosorted, norevsorted;
BUN minpos, maxpos;
double unique_est;
- uint16_t width;
+ uint32_t width;
uint8_t shift;
int8_t type;
bool key:1,
@@ -765,7 +765,7 @@ gdk_export void HEAP_free(Heap *heap, va
gdk_export BAT *COLnew(oid hseq, int tltype, BUN capacity, role_t role)
__attribute__((__warn_unused_result__));
-gdk_export BAT *COLnew2(oid hseq, int tt, BUN cap, role_t role, uint16_t width)
+gdk_export BAT *COLnew2(oid hseq, int tt, BUN cap, role_t role, uint32_t width)
__attribute__((__warn_unused_result__));
gdk_export BAT *BATdense(oid hseq, oid tseq, BUN cnt)
__attribute__((__warn_unused_result__));
@@ -773,7 +773,7 @@ gdk_export gdk_return BATextend(BAT *b,
__attribute__((__warn_unused_result__));
/* internal */
-gdk_export uint8_t ATOMelmshift(int sz)
+gdk_export uint8_t ATOMelmshift(uint32_t sz)
__attribute__((__const__));
gdk_export gdk_return ATOMheap(int id, Heap *hp, size_t cap)
__attribute__((__warn_unused_result__));
@@ -1014,7 +1014,7 @@ gdk_export gdk_return BATsort(BAT **sort
__attribute__((__warn_unused_result__));
-gdk_export void GDKqsort(void *restrict h, void *restrict t, const void
*restrict base, size_t n, int hs, int ts, int tpe, bool reverse, bool nilslast);
+gdk_export void GDKqsort(void *restrict h, void *restrict t, const void
*restrict base, size_t n, size_t hs, size_t ts, int tpe, bool reverse, bool
nilslast);
/* BAT is dense (i.e., BATtvoid() is true and tseqbase is not NIL) */
__attribute__((__pure__))
diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -299,7 +299,7 @@ GDKanalyticalfirst(BAT *b, BAT *s, BAT *
has_nils |= atomeq(curval, nil);
}
} else {
- uint16_t width = r->twidth;
+ uint32_t width = r->twidth;
uint8_t *restrict rcast = (uint8_t *) Tloc(r, 0);
for (; k < cnt; k++) {
const void *curval = (end[k] > start[k]) ?
BUNtloc(&bi, start[k]) : nil;
@@ -393,7 +393,7 @@ GDKanalyticallast(BAT *b, BAT *s, BAT *e
has_nils |= atomeq(curval, nil);
}
} else {
- uint16_t width = r->twidth;
+ uint32_t width = r->twidth;
uint8_t *restrict rcast = (uint8_t *) Tloc(r, 0);
for (; k < cnt; k++) {
const void *curval = (end[k] > start[k]) ?
BUNtloc(&bi, end[k] - 1) : nil;
@@ -530,7 +530,7 @@ GDKanalyticalnthvalue(BAT *b, BAT *s, BA
}
} else {
uint8_t *restrict rcast = (uint8_t *) Tloc(r,
0);
- uint16_t width = r->twidth;
+ uint32_t width = r->twidth;
for (; k < cnt; k++) {
lng lnth = tp[k];
if (!is_lng_nil(nth) && nth <= 0) goto
invalidnth;
@@ -604,7 +604,7 @@ GDKanalyticalnthvalue(BAT *b, BAT *s, BA
}
}
} else {
- uint16_t width = r->twidth;
+ uint32_t width = r->twidth;
uint8_t *restrict rcast = (uint8_t *) Tloc(r,
0);
if (is_lng_nil(nth)) {
has_nils = true;
@@ -1370,7 +1370,7 @@ GDKanalytical##OP(BAT *p, BAT *o, BAT *b
bool (*atomeq)(const void *, const void *) = ATOMequal(tpe); \
void *segment_tree = NULL; \
gdk_return res = GDK_SUCCEED; \
- uint16_t width = r->twidth; \
+ uint32_t width = r->twidth; \
uint8_t *restrict rcast = (uint8_t *) Tloc(r, 0); \
Heap *st = NULL; \
\
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -47,7 +47,7 @@ typedef struct {
char name[IDLENGTH];
uint8_t storage; /* stored as another type? */
bool linear; /* atom can be ordered linearly */
- uint16_t size; /* fixed size of atom */
+ uint32_t size; /* fixed size of atom */
/* automatically generated fields */
const void *atomNull; /* global nil value */
@@ -450,7 +450,7 @@ strEq(const char *l, const char *r)
__attribute__((__pure__))
static inline size_t
-VarHeapVal(const void *b, BUN p, int w)
+VarHeapVal(const void *b, BUN p, uint32_t w)
{
switch (w) {
case 1:
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -109,7 +109,7 @@ BUNtpos(BATiter *bi, BUN p)
}
BAT *
-BATcreatedesc(oid hseq, int tt, bool heapnames, role_t role, uint16_t width)
+BATcreatedesc(oid hseq, int tt, bool heapnames, role_t role, uint32_t width)
{
bat bid;
BAT *bn;
@@ -202,10 +202,10 @@ BATcreatedesc(oid hseq, int tt, bool hea
}
uint8_t
-ATOMelmshift(int sz)
+ATOMelmshift(uint32_t sz)
{
uint8_t sh;
- int i = sz >> 1;
+ uint32_t i = sz >> 1;
for (sh = 0; i != 0; sh++) {
i >>= 1;
@@ -215,7 +215,7 @@ ATOMelmshift(int sz)
void
-BATsetdims(BAT *b, uint16_t width)
+BATsetdims(BAT *b, uint32_t width)
{
b->twidth = b->ttype == TYPE_str ? width > 0 ? width : 1 :
ATOMsize(b->ttype);
b->tshift = ATOMelmshift(b->twidth);
@@ -245,7 +245,7 @@ BATtailname(const BAT *b)
}
void
-settailname(Heap *restrict tail, const char *restrict physnme, int tt, int
width)
+settailname(Heap *restrict tail, const char *restrict physnme, int tt,
uint32_t width)
{
if (tt == TYPE_str) {
switch (width) {
@@ -289,7 +289,7 @@ settailname(Heap *restrict tail, const c
* filenames.
*/
BAT *
-COLnew2(oid hseq, int tt, BUN cap, role_t role, uint16_t width)
+COLnew2(oid hseq, int tt, BUN cap, role_t role, uint32_t width)
{
BAT *bn;
@@ -2774,7 +2774,7 @@ BATassertProps(BAT *b)
MT_lock_unset(&b->theaplock);
return;
}
- assert(1 << b->tshift == b->twidth);
+ assert(UINT32_C(1) << b->tshift == b->twidth);
/* only linear atoms can be sorted */
assert(!b->tsorted || ATOMlinear(b->ttype));
assert(!b->trevsorted || ATOMlinear(b->ttype));
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -2408,7 +2408,7 @@ BATordered_rev(BAT *b)
* "quick" sort does not produce errors */
static gdk_return
do_sort(void *restrict h, void *restrict t, const void *restrict base,
- size_t n, int hs, int ts, int tpe, bool reverse, bool nilslast,
+ size_t n, size_t hs, size_t ts, int tpe, bool reverse, bool nilslast,
bool stable)
{
if (n <= 1) /* trivially sorted */
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -456,7 +456,7 @@ heapinit(BAT *b, const char *buf,
{
int t;
char type[33];
- uint16_t width;
+ uint32_t width;
uint16_t var;
uint16_t properties;
uint64_t nokey0;
@@ -476,7 +476,7 @@ heapinit(BAT *b, const char *buf,
storage = STORE_INVALID; /* for GDKLIBRARY_HSIZE case */
if (bbpversion <= GDKLIBRARY_HSIZE ?
sscanf(buf,
- " %10s %" SCNu16 " %" SCNu16 " %" SCNu16 " %" SCNu64
+ " %10s %" SCNu32 " %" SCNu16 " %" SCNu16 " %" SCNu64
" %" SCNu64 " %" SCNu64 " %" SCNu64 " %" SCNu64
" %" SCNu64 " %" SCNu64 " %" SCNu16 " %" SCNu64 " %" SCNu64
"%n",
@@ -485,7 +485,7 @@ heapinit(BAT *b, const char *buf,
&free, &size, &storage, &minpos, &maxpos,
&n) < 14 :
sscanf(buf,
- " %10s %" SCNu16 " %" SCNu16 " %" SCNu16 " %" SCNu64
+ " %10s %" SCNu32 " %" SCNu16 " %" SCNu16 " %" SCNu64
" %" SCNu64 " %" SCNu64 " %" SCNu64 " %" SCNu64
" %" SCNu64 " %" SCNu64 " %" SCNu64
"%n",
@@ -2079,7 +2079,7 @@ heap_entry(FILE *fp, BATiter *bi, BUN si
free = 0;
}
- return fprintf(fp, " %s %d %d %d " BUNFMT " " BUNFMT " " BUNFMT " "
+ return fprintf(fp, " %s %" PRIu32 " %d %d " BUNFMT " " BUNFMT " "
BUNFMT " "
BUNFMT " " OIDFMT " %zu %" PRIu64" %" PRIu64,
bi->type >= 0 ? BATatoms[bi->type].name :
ATOMunknown_name(bi->type),
bi->width,
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -1105,7 +1105,7 @@ BATcalcmin(BAT *b1, BAT *b2, BAT *s1, BA
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
if (ci1.tpe == cand_dense && ci2.tpe == cand_dense) {
TIMEOUT_LOOP(ci1.ncand, qry_ctx) {
oid x1 = canditer_next_dense(&ci1) -
b1hseqbase;
@@ -1332,7 +1332,7 @@ BATcalcmin_no_nil(BAT *b1, BAT *b2, BAT
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
if (ci1.tpe == cand_dense && ci2.tpe == cand_dense) {
TIMEOUT_LOOP(ci1.ncand, qry_ctx) {
oid x1 = canditer_next_dense(&ci1) -
b1hseqbase;
@@ -1512,7 +1512,7 @@ BATcalcmincst(BAT *b, const ValRecord *v
GOTO_LABEL_TIMEOUT_HANDLER(bailout,
qry_ctx));
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
TIMEOUT_LOOP(ci.ncand, qry_ctx) {
oid x = canditer_next(&ci) - bhseqbase;
const void *restrict p1 = BUNtloc(&bi, x);
@@ -1685,7 +1685,7 @@ BATcalcmincst_no_nil(BAT *b, const ValRe
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
if (eq(p2, nil)) {
TIMEOUT_LOOP(ci.ncand, qry_ctx) {
oid x = canditer_next(&ci) - bhseqbase;
@@ -1849,7 +1849,7 @@ BATcalcmax(BAT *b1, BAT *b2, BAT *s1, BA
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
if (ci1.tpe == cand_dense && ci2.tpe == cand_dense) {
TIMEOUT_LOOP(ci1.ncand, qry_ctx) {
oid x1 = canditer_next_dense(&ci1) -
b1hseqbase;
@@ -2036,7 +2036,7 @@ BATcalcmax_no_nil(BAT *b1, BAT *b2, BAT
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
if (ci1.tpe == cand_dense && ci2.tpe == cand_dense) {
TIMEOUT_LOOP(ci1.ncand, qry_ctx) {
oid x1 = canditer_next_dense(&ci1) -
b1hseqbase;
@@ -2201,7 +2201,7 @@ BATcalcmaxcst(BAT *b, const ValRecord *v
GOTO_LABEL_TIMEOUT_HANDLER(bailout,
qry_ctx));
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
+ uint32_t width = bn->twidth;
TIMEOUT_LOOP(ci.ncand, qry_ctx) {
oid x = canditer_next(&ci) - bhseqbase;
const void *restrict p1 = BUNtloc(&bi, x);
@@ -2347,7 +2347,7 @@ BATcalcmaxcst_no_nil(BAT *b, const ValRe
}
} else {
uint8_t *restrict bcast = (uint8_t *) Tloc(bn, 0);
- uint16_t width = bn->twidth;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]