Skip to main content

get_size2/impls/feature/
portable_atomic.rs

1use crate::GetSize;
2
3// `portable-atomic` provides atomic types that work on every target, including
4// 32-bit ones (e.g. ppc32) that lack native 64-bit atomics and therefore have
5// no `std::sync::atomic::AtomicU64`/`AtomicI64` (see issue #54). These impls let
6// crates that reach for `portable_atomic` on such targets still measure size.
7//
8// Like their std counterparts in `impls/primitives.rs`, these are stack-only
9// types, so the default `get_heap_size` (returning 0) is correct.
10
11impl GetSize for portable_atomic::AtomicBool {}
12impl GetSize for portable_atomic::AtomicI8 {}
13impl GetSize for portable_atomic::AtomicI16 {}
14impl GetSize for portable_atomic::AtomicI32 {}
15impl GetSize for portable_atomic::AtomicI64 {}
16impl GetSize for portable_atomic::AtomicI128 {}
17impl GetSize for portable_atomic::AtomicIsize {}
18impl GetSize for portable_atomic::AtomicU8 {}
19impl GetSize for portable_atomic::AtomicU16 {}
20impl GetSize for portable_atomic::AtomicU32 {}
21impl GetSize for portable_atomic::AtomicU64 {}
22impl GetSize for portable_atomic::AtomicU128 {}
23impl GetSize for portable_atomic::AtomicUsize {}