From: Peizhao Ou Date: Fri, 21 Mar 2014 21:16:13 +0000 (-0700) Subject: injection result for deque X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9af747690356f40fa8ee4496c8f3bdb04015c404;p=cdsspec-compiler.git injection result for deque --- diff --git a/benchmark/chase-lev-deque-bugfix/deque.c b/benchmark/chase-lev-deque-bugfix/deque.c index e94da48..1ebeb13 100644 --- a/benchmark/chase-lev-deque-bugfix/deque.c +++ b/benchmark/chase-lev-deque-bugfix/deque.c @@ -79,6 +79,7 @@ void resize(Deque *q) { for(i=top; i < bottom; i++) { atomic_store_explicit(&new_a->buffer[i % new_size], atomic_load_explicit(&a->buffer[i % size], memory_order_relaxed), memory_order_relaxed); } + /**** FIXME: detected failure ****/ atomic_store_explicit(&q->array, new_a, memory_order_release); printf("resize\n"); } @@ -90,6 +91,7 @@ void resize(Deque *q) { */ void push(Deque *q, int x) { size_t b = atomic_load_explicit(&q->bottom, memory_order_relaxed); + /**** FIXME: detected correctness ****/ size_t t = atomic_load_explicit(&q->top, memory_order_acquire); Array *a = (Array *) atomic_load_explicit(&q->array, memory_order_relaxed); if (b - t > atomic_load_explicit(&a->size, memory_order_relaxed) - 1) /* Full queue. */ {