Changeset: c3bd6b30fe74 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c3bd6b30fe74
Modified Files:
NT/rules.msc
common/utils/muuid.c
gdk/gdk_bbp.c
monetdb5/modules/kernel/microbenchmark.c
testing/Mtest.py.in
tools/merovingian/daemon/discoveryrunner.c
Branch: default
Log Message:
Merge with Oct2014 branch.
diffs (222 lines):
diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -312,16 +312,6 @@ create_winconfig_conds_new_py:
!ELSE
$(ECHO) CROSS_COMPILING_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
!ENDIF
-!IFDEF DOCTOOLS
- $(ECHO) DOCTOOLS_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ELSE
- $(ECHO) DOCTOOLS_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ENDIF
-!IFDEF ENABLE_CRACKERS
- $(ECHO) ENABLE_CRACKERS_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ELSE
- $(ECHO) ENABLE_CRACKERS_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ENDIF
!IFDEF ENABLE_DATACELL
$(ECHO) ENABLE_DATACELL_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
!ELSE
diff --git a/common/utils/muuid.c b/common/utils/muuid.c
--- a/common/utils/muuid.c
+++ b/common/utils/muuid.c
@@ -52,16 +52,16 @@ generateUUID(void)
/* try to do some pseudo interesting stuff, and stash it in the
* format of a UUID to at least return some uniform answer */
char out[37];
- union {
- unsigned char randbuf[16];
- unsigned short s[8];
- } r;
+ unsigned char randbuf[16];
- if (RAND_bytes(r.randbuf, 16) >= 0) {
+ if (RAND_bytes(randbuf, 16) >= 0) {
snprintf(out, sizeof(out),
- "%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
- r.s[0], r.s[1], r.s[2], r.s[3],
- r.s[4], r.s[5], r.s[6], r.s[7]);
+ "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x",
+ randbuf[0], randbuf[1], randbuf[2], randbuf[3],
+ randbuf[4], randbuf[5], randbuf[6], randbuf[7],
+ randbuf[8], randbuf[9], randbuf[10], randbuf[11],
+ randbuf[12], randbuf[13], randbuf[14], randbuf[15]);
} else {
/* generate something like this:
* cefa7a9c-1dd2-11b2-8350-880020adbeef
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1711,24 +1711,28 @@ BBPcurstamp(void)
}
/* There are BBP_THREADMASK+1 (64) free lists, and ours (idx) is
- * empty. Here we find the longest free list, and if it is long
- * enough (> 20 entries) we take one entry from that list. If the
- * longest list isn't long enough, we create a new entry by either
- * just increasing BBPsize (up to BBPlimit) or extending the BBP
- * (which increases BBPlimit). */
+ * empty. Here we find a longish free list (at least 20 entries), and
+ * if we can find one, we take one entry from that list. If no long
+ * enough list can be found, we create a new entry by either just
+ * increasing BBPsize (up to BBPlimit) or extending the BBP (which
+ * increases BBPlimit). Every time this function is called we start
+ * searching in a following free list (variable "last"). */
static void
maybeextend(int idx)
{
int t, m;
int n, l;
bat i;
+ static int last = 0;
l = 0; /* length of longest list */
m = 0; /* index of longest list */
- /* find longest free list */
- for (t = 0; t <= BBP_THREADMASK; t++) {
+ /* find a longish free list */
+ for (t = 0; t <= BBP_THREADMASK && l <= 20; t++) {
n = 0;
- for (i = BBP_free(t); i != 0; i = BBP_next(i))
+ for (i = BBP_free((t + last) & BBP_THREADMASK);
+ i != 0 && n <= 20;
+ i = BBP_next(i))
n++;
if (n > l) {
m = t;
@@ -1736,7 +1740,7 @@ maybeextend(int idx)
}
}
if (l > 20) {
- /* longest list is long enough, get an entry from there */
+ /* list is long enough, get an entry from there */
i = BBP_free(m);
BBP_free(m) = BBP_next(i);
BBP_next(i) = 0;
@@ -1749,6 +1753,7 @@ maybeextend(int idx)
BBP_free(idx) = (bat) ATOMIC_GET(BBPsize, BBPsizeLock,
"BBPinsert") - 1;
}
}
+ last = (last + 1) & BBP_THREADMASK;
}
bat
diff --git a/monetdb5/modules/kernel/microbenchmark.c
b/monetdb5/modules/kernel/microbenchmark.c
--- a/monetdb5/modules/kernel/microbenchmark.c
+++ b/monetdb5/modules/kernel/microbenchmark.c
@@ -76,12 +76,16 @@ BATrandom(BAT **bn, oid *base, wrd *size
srand(seed);
if (*domain == int_nil) {
BATloop(b, p, q) {
- /* coverity[dont_call] */
*(int *) Tloc(b, p) = rand();
}
+#if RAND_MAX < 46340 /* 46340*46340 = 2147395600 < INT_MAX */
+ } else if (*domain > RAND_MAX + 1) {
+ BATloop(b, p, q) {
+ *(int *) Tloc(b, p) = (rand() * (RAND_MAX + 1) +
rand()) % *domain;
+ }
+#endif
} else {
BATloop(b, p, q) {
- /* coverity[dont_call] */
*(int *) Tloc(b, p) = rand() % *domain;
}
}
@@ -145,7 +149,6 @@ BATuniform(BAT **bn, oid *base, wrd *siz
/* mix BUNs randomly */
for (r = i = 0; i < n; i++) {
- /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
@@ -218,18 +221,15 @@ BATskewed(BAT **bn, oid *base, wrd *size
lastbun = firstbun + skewedSize;
for(p=firstbun; p <lastbun; p++)
- /* coverity[dont_call] */
*(int *) Tloc(b, p) = (int)rand() % skewedDomain;
lastbun = BUNlast(b);
for(; p <lastbun; p++)
- /* coverity[dont_call] */
*(int *) Tloc(b, p) = ((int)rand() % (*domain-skewedDomain)) +
skewedDomain;
/* mix BUNs randomly */
for (r = i = 0; i < n; i++) {
- /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
@@ -332,7 +332,6 @@ BATnormal(BAT **bn, oid *base, wrd *size
/* mix BUNs randomly */
for (r = 0, i = 0; i < n; i++) {
- /* coverity[dont_call] */
BUN idx = i + (BUN) ((r += (unsigned int) rand()) % (n - i));
int val;
@@ -415,7 +414,6 @@ MBMmix(bat *bn, bat *batid)
firstbun = BUNfirst(b);
/* mix BUNs randomly */
for (r = i = 0; i < n; i++) {
- /* coverity[dont_call] */
BUN idx = i + ((r += (BUN) rand()) % (n - i));
int val;
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -304,8 +304,6 @@ CONDITIONALS = {
'BITS32' : "@BITS32_FALSE@",
'BITS64' : "@BITS64_FALSE@",
'CROSS_COMPILING' : "@CROSS_COMPILING_FALSE@",
- 'DOCTOOLS' : "@DOCTOOLS_FALSE@",
- 'ENABLE_CRACKERS' : "@ENABLE_CRACKERS_FALSE@",
'ENABLE_DATACELL' : "@ENABLE_DATACELL_FALSE@",
'HAVE_CFITSIO' : "@HAVE_CFITSIO_FALSE@",
'HAVE_CURL' : "@HAVE_CURL_FALSE@",
diff --git a/tools/merovingian/daemon/discoveryrunner.c
b/tools/merovingian/daemon/discoveryrunner.c
--- a/tools/merovingian/daemon/discoveryrunner.c
+++ b/tools/merovingian/daemon/discoveryrunner.c
@@ -296,7 +296,6 @@ discoveryRunner(void *d)
socklen_t peer_addr_len;
fd_set fds;
struct timeval tv;
- int c;
/* avoid first announce, the HELO will cause an announce when it's
* received by ourself */
time_t deadline = 1;
@@ -452,9 +451,9 @@ discoveryRunner(void *d)
Mfprintf(_mero_discout, "new neighbour %s (%s)\n", buf
+ 5, host);
/* sleep a random amount of time to avoid an avalanche
of
* ANNC messages flooding the network */
- /* coverity[dont_call] */
- c = 1 + (int)(2500.0 * (rand() / (RAND_MAX + 1.0)));
- sleep_ms(c);
+#ifndef STATIC_CODE_ANALYSIS /* hide rand() from Coverity */
+ sleep_ms(1 + (int)(2500.0 * (rand() / (RAND_MAX +
1.0))));
+#endif
/* force an announcement round by dropping the deadline
*/
forceannc = 1;
continue;
@@ -518,7 +517,6 @@ discoveryRunner(void *d)
}
/* craft LEAV messages for each db */
- c = 0;
orig = stats;
while (stats != NULL) {
readProps(ckv, stats->path);
@@ -528,7 +526,6 @@ discoveryRunner(void *d)
stats->dbname, _mero_hostname,
(unsigned int)getConfNum(_mero_props,
"port"));
broadcast(buf);
- c = 1;
}
freeConfFile(ckv);
stats = stats->next;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list