aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/atomic_gcc.h
diff options
context:
space:
mode:
authorvskipin <vskipin@yandex-team.ru>2022-02-10 16:46:00 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:00 +0300
commit4d8b546b89b5afc08cf3667e176271c7ba935f33 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system/atomic_gcc.h
parent4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (diff)
downloadydb-4d8b546b89b5afc08cf3667e176271c7ba935f33.tar.gz
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/atomic_gcc.h')
-rw-r--r--util/system/atomic_gcc.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/system/atomic_gcc.h b/util/system/atomic_gcc.h
index 39d3987fdf..ed8dc2bdc5 100644
--- a/util/system/atomic_gcc.h
+++ b/util/system/atomic_gcc.h
@@ -5,32 +5,32 @@
: \
: "memory")
-static inline TAtomicBase AtomicGet(const TAtomic& a) {
- TAtomicBase tmp;
+static inline TAtomicBase AtomicGet(const TAtomic& a) {
+ TAtomicBase tmp;
#if defined(_arm64_)
- __asm__ __volatile__(
- "ldar %x[value], %[ptr] \n\t"
- : [value] "=r"(tmp)
- : [ptr] "Q"(a)
- : "memory");
+ __asm__ __volatile__(
+ "ldar %x[value], %[ptr] \n\t"
+ : [value] "=r"(tmp)
+ : [ptr] "Q"(a)
+ : "memory");
#else
- __atomic_load(&a, &tmp, __ATOMIC_ACQUIRE);
+ __atomic_load(&a, &tmp, __ATOMIC_ACQUIRE);
#endif
- return tmp;
-}
-
-static inline void AtomicSet(TAtomic& a, TAtomicBase v) {
+ return tmp;
+}
+
+static inline void AtomicSet(TAtomic& a, TAtomicBase v) {
#if defined(_arm64_)
- __asm__ __volatile__(
- "stlr %x[value], %[ptr] \n\t"
- : [ptr] "=Q"(a)
- : [value] "r"(v)
- : "memory");
-#else
- __atomic_store(&a, &v, __ATOMIC_RELEASE);
-#endif
+ __asm__ __volatile__(
+ "stlr %x[value], %[ptr] \n\t"
+ : [ptr] "=Q"(a)
+ : [value] "r"(v)
+ : "memory");
+#else
+ __atomic_store(&a, &v, __ATOMIC_RELEASE);
+#endif
}
-
+
static inline intptr_t AtomicIncrement(TAtomic& p) {
return __atomic_add_fetch(&p, 1, __ATOMIC_SEQ_CST);
}
@@ -55,7 +55,7 @@ static inline intptr_t AtomicGetAndAdd(TAtomic& p, intptr_t v) {
return __atomic_fetch_add(&p, v, __ATOMIC_SEQ_CST);
}
-static inline intptr_t AtomicSwap(TAtomic* p, intptr_t v) {
+static inline intptr_t AtomicSwap(TAtomic* p, intptr_t v) {
(void)p; // disable strange 'parameter set but not used' warning on gcc
intptr_t ret;
__atomic_exchange(p, &v, &ret, __ATOMIC_SEQ_CST);