Commit 6727ddee authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

[t:3476] A few improvements for icc. Refs #3476

git-svn-id: file:///svn/toku/tokudb@32355 c7de825b-a66e-492c-adef-691d508d4ae1
parent 9fc3e312
......@@ -57,9 +57,8 @@ unsigned long toku_fifo_memory_size(FIFO); // return how much memory the fifo us
//int toku_fifo_peek_deq_cmdstruct (FIFO, BRT_MSG, DBT*, DBT*); // fill in the BRT_MSG, using the two DBTs for the DBT part.
void toku_fifo_iterate (FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,ITEMLEN datalen,int type, MSN msn, XIDS xids, void*), void*);
#define FIFO_ITERATE(fifo,keyvar,keylenvar,datavar,datalenvar,typevar,msnvar,xidsvar,body) do { \
int fifo_iterate_off; \
for (fifo_iterate_off = toku_fifo_iterate_internal_start(fifo); \
#define FIFO_ITERATE(fifo,keyvar,keylenvar,datavar,datalenvar,typevar,msnvar,xidsvar,body) ({ \
for (int fifo_iterate_off = toku_fifo_iterate_internal_start(fifo); \
toku_fifo_iterate_internal_has_more(fifo, fifo_iterate_off); \
fifo_iterate_off = toku_fifo_iterate_internal_next(fifo, fifo_iterate_off)) { \
struct fifo_entry *e = toku_fifo_iterate_internal_get_entry(fifo, fifo_iterate_off); \
......@@ -70,8 +69,8 @@ void toku_fifo_iterate (FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,I
XIDS xidsvar = &e->xids_s; \
bytevec keyvar = xids_get_end_of_array(xidsvar); \
bytevec datavar = (const u_int8_t*)keyvar + e->keylen; \
body; \
} } while (0)
body; \
} })
// Internal functions for the iterator.
int toku_fifo_iterate_internal_start(FIFO fifo);
......
......@@ -43,8 +43,7 @@ test_fifo_enq (int n) {
memset(theval, ~len, thevallen); \
}
int i;
for (i=0; i<n; i++) {
for (int i=0; i<n; i++) {
buildkey(i);
buildval(i);
XIDS xids;
......@@ -61,7 +60,7 @@ test_fifo_enq (int n) {
xids_destroy(&xids);
}
i = 0;
int i = 0;
FIFO_ITERATE(f, key, keylen, val, vallen, type, msn, xids, {
if (verbose) printf("checkit %d %d %"PRIu64"\n", i, type, msn.msn);
assert(msn.msn == startmsn.msn + i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment