mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 04:20:24 +00:00
ARMv7-R: implement Sync for Pool
This commit is contained in:
parent
91dfd3ccb8
commit
110239f0c1
@ -10,6 +10,10 @@ matrix:
|
||||
- env: TARGET=x86_64-unknown-linux-gnu
|
||||
rust: nightly
|
||||
|
||||
- env: TARGET=armv7r-none-eabi
|
||||
rust: nightly
|
||||
if: branch != master
|
||||
|
||||
- env: TARGET=thumbv6m-none-eabi
|
||||
rust: nightly
|
||||
if: branch != master
|
||||
|
2
build.rs
2
build.rs
@ -11,6 +11,8 @@ fn main() -> Result<(), Box<Error>> {
|
||||
println!("cargo:rustc-cfg=armv7m");
|
||||
} else if target.starts_with("thumbv7em-") {
|
||||
println!("cargo:rustc-cfg=armv7m");
|
||||
} else if target.starts_with("armv7r-") {
|
||||
println!("cargo:rustc-cfg=armv7r");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -178,7 +178,7 @@ pub struct Pool<T> {
|
||||
// NOTE: Here we lie about `Pool` implementing `Sync` on x86_64. This is not true but it lets us
|
||||
// test the `pool!` and `singleton::Pool` abstractions. We just have to be careful not to use the
|
||||
// pool in a multi-threaded context
|
||||
#[cfg(any(armv7m, test))]
|
||||
#[cfg(any(armv7m, armv7r, test))]
|
||||
unsafe impl<T> Sync for Pool<T> {}
|
||||
|
||||
unsafe impl<T> Send for Pool<T> {}
|
||||
|
@ -15,7 +15,7 @@ use as_slice::{AsMutSlice, AsSlice};
|
||||
use super::{Init, Uninit};
|
||||
|
||||
/// Instantiates a pool as a global singleton
|
||||
#[cfg(any(armv7m, test))]
|
||||
#[cfg(any(armv7m, armv7r, test))]
|
||||
#[macro_export]
|
||||
macro_rules! pool {
|
||||
($ident:ident: $ty:ty) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user