@@ -17,8 +17,13 @@ pub(crate) use aggregate::{AggregateBuilder, ComputeAggregation, Measure};
1717pub ( crate ) use exponential_histogram:: { EXPO_MAX_SCALE , EXPO_MIN_SCALE } ;
1818use once_cell:: sync:: Lazy ;
1919use opentelemetry:: { otel_warn, KeyValue } ;
20+
21+ #[ cfg( any( target_arch = "mips" , target_arch = "powerpc" ) ) ]
2022use portable_atomic:: { AtomicBool , AtomicI64 , AtomicU64 , AtomicUsize } ;
2123
24+ #[ cfg( not( any( target_arch = "mips" , target_arch = "powerpc" ) ) ) ]
25+ use std:: sync:: atomic:: { AtomicBool , AtomicI64 , AtomicU64 , AtomicUsize } ;
26+
2227use crate :: metrics:: AttributeSet ;
2328
2429pub ( crate ) static STREAM_OVERFLOW_ATTRIBUTES : Lazy < Vec < KeyValue > > =
@@ -411,8 +416,8 @@ mod tests {
411416 #[ test]
412417 fn can_add_and_get_u64_atomic_value ( ) {
413418 let atomic = u64:: new_atomic_tracker ( 0 ) ;
414- atomic . add ( 15 ) ;
415- atomic . add ( 10 ) ;
419+ AtomicTracker :: add ( & atomic , 15 ) ;
420+ AtomicTracker :: add ( & atomic , 10 ) ;
416421
417422 let value = atomic. get_value ( ) ;
418423 assert_eq ! ( value, 25 ) ;
@@ -421,7 +426,7 @@ mod tests {
421426 #[ test]
422427 fn can_reset_u64_atomic_value ( ) {
423428 let atomic = u64:: new_atomic_tracker ( 0 ) ;
424- atomic . add ( 15 ) ;
429+ AtomicTracker :: add ( & atomic , 15 ) ;
425430
426431 let value = atomic. get_and_reset_value ( ) ;
427432 let value2 = atomic. get_value ( ) ;
@@ -450,8 +455,8 @@ mod tests {
450455 #[ test]
451456 fn can_add_and_get_i64_atomic_value ( ) {
452457 let atomic = i64:: new_atomic_tracker ( 0 ) ;
453- atomic . add ( 15 ) ;
454- atomic . add ( -10 ) ;
458+ AtomicTracker :: add ( & atomic , 15 ) ;
459+ AtomicTracker :: add ( & atomic , -10 ) ;
455460
456461 let value = atomic. get_value ( ) ;
457462 assert_eq ! ( value, 5 ) ;
@@ -460,7 +465,7 @@ mod tests {
460465 #[ test]
461466 fn can_reset_i64_atomic_value ( ) {
462467 let atomic = i64:: new_atomic_tracker ( 0 ) ;
463- atomic . add ( 15 ) ;
468+ AtomicTracker :: add ( & atomic , 15 ) ;
464469
465470 let value = atomic. get_and_reset_value ( ) ;
466471 let value2 = atomic. get_value ( ) ;
0 commit comments