From 4107564ecc94203d787ef0a6d02f24bc71dde8ee Mon Sep 17 00:00:00 2001 From: Manuel Pitz Date: Mon, 8 Apr 2019 14:04:07 +0100 Subject: [PATCH 1/2] memory: fix jump lable position for arm ifdef --- lib/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/memory.cpp b/lib/memory.cpp index a51ce4253..fed012e2a 100644 --- a/lib/memory.cpp +++ b/lib/memory.cpp @@ -91,8 +91,8 @@ int memory_lock(size_t lock) debug(LOG_MEM | 2, "Increased ressource limit of locked memory to %zd bytes", lock); } -#endif /* __arm__ */ out: +#endif /* __arm__ */ #ifdef _POSIX_MEMLOCK /* Lock all current and future memory allocations */ ret = mlockall(MCL_CURRENT | MCL_FUTURE); From 410a7bedbcf00119a9b8fc968f4a09f8168b96ca Mon Sep 17 00:00:00 2001 From: Manuel Pitz Date: Mon, 8 Apr 2019 17:21:31 +0200 Subject: [PATCH 2/2] queue: fix atomic_store_explicit different implementation on arm --- lib/queue.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/queue.cpp b/lib/queue.cpp index 8f560a009..53c1893d7 100644 --- a/lib/queue.cpp +++ b/lib/queue.cpp @@ -57,9 +57,14 @@ int queue_init(struct queue *q, size_t size, struct memory_type *m) for (size_t i = 0; i != size; i += 1) std::atomic_store_explicit(&buffer[i].sequence, i, std::memory_order_relaxed); +#ifndef __arm__ std::atomic_store_explicit(&q->tail, 0ul, std::memory_order_relaxed); std::atomic_store_explicit(&q->head, 0ul, std::memory_order_relaxed); +#else + std::atomic_store_explicit(&q->tail, 0u, std::memory_order_relaxed); + std::atomic_store_explicit(&q->head, 0u, std::memory_order_relaxed); +#endif q->state = STATE_INITIALIZED; return 0;