regressions: Silence some irrelevant compiler warnings.

ck_pring
Samy Al Bahra 14 years ago
parent e1219a4d17
commit c46bc1f1d7

@ -73,6 +73,12 @@ read_thread(void *unused CK_CC_UNUSED)
unsigned int j; unsigned int j;
ck_epoch_record_t record; ck_epoch_record_t record;
ck_stack_entry_t *cursor; ck_stack_entry_t *cursor;
/*
* This is redundant post-incremented in order to silence some
* irrelevant GCC warnings. It is volatile in order to prevent
* elimination.
*/
volatile ck_stack_entry_t *n; volatile ck_stack_entry_t *n;
ck_epoch_register(&stack_epoch, &record); ck_epoch_register(&stack_epoch, &record);
@ -98,6 +104,7 @@ read_thread(void *unused CK_CC_UNUSED)
CK_STACK_FOREACH(&stack, cursor) { CK_STACK_FOREACH(&stack, cursor) {
n = cursor; n = cursor;
j++; j++;
n++;
} }
ck_epoch_end(&record); ck_epoch_end(&record);

@ -65,7 +65,7 @@ CK_STACK_CONTAINER(struct node, stack_entry, stack_container)
static struct affinity a; static struct affinity a;
static void * static void *
thread(void *unused) thread(void *unused CK_CC_UNUSED)
{ {
struct node **entry, *e; struct node **entry, *e;
unsigned int i; unsigned int i;

@ -139,7 +139,7 @@ stack_pop_mpmc(ck_hp_record_t *record, struct stack *target)
} }
static void * static void *
thread(void *unused) thread(void *unused CK_CC_UNUSED)
{ {
struct node *entry, *e; struct node *entry, *e;
unsigned int i; unsigned int i;

@ -49,7 +49,7 @@ static unsigned int barrier;
static struct affinity affinerator; static struct affinity affinerator;
static void * static void *
consumer(void *unused) consumer(void *unused CK_CC_UNUSED)
{ {
struct example copy; struct example copy;
uint32_t version; uint32_t version;

@ -40,6 +40,11 @@
#define STEPS 40000 #define STEPS 40000
#endif #endif
/*
* Note the redundant post-increment of r. This is to silence
* some irrelevant GCC warnings.
*/
static ck_stack_t stack; static ck_stack_t stack;
int int
@ -85,6 +90,7 @@ main(void)
a += e - s; a += e - s;
} }
printf(" spinlock_pop: %16" PRIu64 "\n", a / STEPS / ENTRIES); printf(" spinlock_pop: %16" PRIu64 "\n", a / STEPS / ENTRIES);
r++;
#ifdef CK_F_STACK_PUSH_UPMC #ifdef CK_F_STACK_PUSH_UPMC
a = 0; a = 0;
@ -163,6 +169,7 @@ main(void)
a += e - s; a += e - s;
} }
printf(" ck_stack_pop_mpmc: %16" PRIu64 "\n", a / STEPS / (sizeof(entry) / sizeof(*entry))); printf(" ck_stack_pop_mpmc: %16" PRIu64 "\n", a / STEPS / (sizeof(entry) / sizeof(*entry)));
r++;
#endif #endif
return 0; return 0;

Loading…
Cancel
Save