all repos — mgba @ 5d28145b525e81de9c531b1dbc531203d9827e03

mGBA Game Boy Advance Emulator

Util: Fix RingFIFOSize...
Vicki Pfau vi@endrift.com
Sun, 23 Sep 2018 20:32:58 -0700
commit

5d28145b525e81de9c531b1dbc531203d9827e03

parent

41c08151f3815af843491d1659f9770c4c115e6d

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/util/ring-fifo.csrc/util/ring-fifo.c

@@ -26,7 +26,7 @@ size_t RingFIFOSize(const struct RingFIFO* buffer) {

const void* read; const void* write; ATOMIC_LOAD(read, buffer->readPtr); - ATOMIC_LOAD(write, buffer->readPtr); + ATOMIC_LOAD(write, buffer->writePtr); if (read <= write) { return (uintptr_t) write - (uintptr_t) read; } else {