Skip to content

Commit e6db79e

Browse files
committed
*: exclude AtomicU64 from xtensa
Signed-off-by: sh0rez <me@shorez.de>
1 parent bc25dd1 commit e6db79e

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/metrics/counter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use super::{MetricType, TypedMetric};
66
use std::marker::PhantomData;
7-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
7+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
88
use std::sync::atomic::AtomicU64;
99
use std::sync::atomic::{AtomicU32, Ordering};
1010
use std::sync::Arc;
@@ -38,13 +38,13 @@ use std::sync::Arc;
3838
/// counter.inc();
3939
/// let _value: f64 = counter.get();
4040
/// ```
41-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
41+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
4242
pub struct Counter<N = u64, A = AtomicU64> {
4343
value: Arc<A>,
4444
phantom: PhantomData<N>,
4545
}
4646

47-
#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
47+
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa"))]
4848
pub struct Counter<N = u32, A = AtomicU32> {
4949
value: Arc<A>,
5050
phantom: PhantomData<N>,
@@ -105,7 +105,7 @@ pub trait Atomic<N> {
105105
fn get(&self) -> N;
106106
}
107107

108-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
108+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
109109
impl Atomic<u64> for AtomicU64 {
110110
fn inc(&self) -> u64 {
111111
self.inc_by(1)

src/metrics/exemplar.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use super::counter::{self, Counter};
66
use super::histogram::Histogram;
77
use owning_ref::OwningRef;
88
use std::collections::HashMap;
9-
#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
9+
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch="xtensa"))]
1010
use std::sync::atomic::AtomicU32;
11-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
11+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch="xtensa")))]
1212
use std::sync::atomic::AtomicU64;
1313
use std::sync::{Arc, RwLock, RwLockReadGuard};
1414

@@ -29,12 +29,12 @@ pub struct Exemplar<S, V> {
2929
/// counter_with_exemplar.inc_by(1, Some(vec![("user_id".to_string(), "42".to_string())]));
3030
/// let _value: (u64, _) = counter_with_exemplar.get();
3131
/// ```
32-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
32+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch="xtensa")))]
3333
pub struct CounterWithExemplar<S, N = u64, A = AtomicU64> {
3434
pub(crate) inner: Arc<RwLock<CounterWithExemplarInner<S, N, A>>>,
3535
}
3636

37-
#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
37+
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch="xtensa"))]
3838
pub struct CounterWithExemplar<S, N = u32, A = AtomicU32> {
3939
pub(crate) inner: Arc<RwLock<CounterWithExemplarInner<S, N, A>>>,
4040
}

src/metrics/gauge.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use super::{MetricType, TypedMetric};
66
use std::marker::PhantomData;
7-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
7+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
88
use std::sync::atomic::AtomicU64;
99
use std::sync::atomic::{AtomicU32, Ordering};
1010
use std::sync::Arc;
@@ -38,13 +38,13 @@ use std::sync::Arc;
3838
/// gauge.set(42.0);
3939
/// let _value: f64 = gauge.get();
4040
/// ```
41-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
41+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
4242
pub struct Gauge<N = u64, A = AtomicU64> {
4343
value: Arc<A>,
4444
phantom: PhantomData<N>,
4545
}
4646

47-
#[cfg(any(target_arch = "mips", target_arch = "powerpc"))]
47+
#[cfg(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa"))]
4848
pub struct Gauge<N = u32, A = AtomicU32> {
4949
value: Arc<A>,
5050
phantom: PhantomData<N>,
@@ -122,7 +122,7 @@ pub trait Atomic<N> {
122122
fn get(&self) -> N;
123123
}
124124

125-
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
125+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc", target_arch = "xtensa")))]
126126
impl Atomic<u64> for AtomicU64 {
127127
fn inc(&self) -> u64 {
128128
self.inc_by(1)

0 commit comments

Comments
 (0)