-
Notifications
You must be signed in to change notification settings - Fork 734
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
appender: fix compilation 32-bit platforms like PowerPC (#1675)
This branch is @dzvon's PR #1508, with the following changes: * Add a newtype wrapping the error counter to hide that it's internally an `Arc<AtomicUsize>`. This would allow us to make additional changes to the implementation without potentially causing breaking changes. * Use saturating arithmetic when incrementing the counter to avoid wrapping to 0 on overflows. This is more likely to be an issue on 32-bit platforms. This is a breaking change that will be released as part of `tracing-appender` 0.2. Closes #1508 Description from @dzvon's original PR: ## Motivation Currently, tracing-appender crate cannot be compiled on PowerPC platform. Because > PowerPC and MIPS platforms with 32-bit pointers do not have > `AtomicU64` or `AtomicI64` types. quote from std library docs. (https://doc.rust-lang.org/std/sync/atomic/index.html#portability) ## Solution Change `AtomicU64` to `AtomicUsize`. Co-authored-by: Dezhi Wu <[email protected]>
- Loading branch information
Showing
1 changed file
with
59 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters