mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
80972f1e0e
This is a `core` patch to make wakers 1 word (the task pointer) instead of 2 (task pointer + vtable). It allows having the "waker optimization" we had a while back on `WakerRegistration/AtomicWaker`, but EVERYWHERE, without patching all crates. Advantages: - Less memory usage. - Faster. - `AtomicWaker` can actually use atomics to load/store the waker, No critical section needed. - No `dyn` call, which means `cargo-call-stack` can now see through wakes. Disadvantages: - You have to patch `core`... - Breaks all executors and other things that create wakers, unless they opt in to using the new `from_ptr` API. How to use: - Run this shell script to patch `core`. https://gist.github.com/Dirbaio/c67da7cf318515181539122c9d32b395 - Enable `build-std` - Enable `build-std-features = core/turbowakers` - Enable feature `turbowakers` in `embassy-executor`, `embassy-sync`. - Make sure you have no other crate creating wakers other than `embassy-executor`. These will panic at runtime. Note that the patched `core` is equivalent to the unpached one when the `turbowakers` feature is not enabled, so it should be fine to leave it there.
64 lines
2.4 KiB
TOML
64 lines
2.4 KiB
TOML
[package]
|
|
name = "embassy-executor"
|
|
version = "0.1.1"
|
|
edition = "2021"
|
|
license = "MIT OR Apache-2.0"
|
|
description = "async/await executor designed for embedded usage"
|
|
repository = "https://github.com/embassy-rs/embassy"
|
|
categories = [
|
|
"embedded",
|
|
"no-std",
|
|
"asynchronous",
|
|
]
|
|
|
|
[package.metadata.embassy_docs]
|
|
src_base = "https://github.com/embassy-rs/embassy/blob/embassy-executor-v$VERSION/embassy-executor/src/"
|
|
src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-executor/src/"
|
|
features = ["nightly", "defmt"]
|
|
flavors = [
|
|
{ name = "std", target = "x86_64-unknown-linux-gnu", features = ["std"] },
|
|
{ name = "wasm", target = "wasm32-unknown-unknown", features = ["wasm"] },
|
|
{ name = "thumbv6m-none-eabi", target = "thumbv6m-none-eabi", features = [] },
|
|
{ name = "thumbv7m-none-eabi", target = "thumbv7m-none-eabi", features = [] },
|
|
{ name = "thumbv7em-none-eabi", target = "thumbv7em-none-eabi", features = [] },
|
|
{ name = "thumbv7em-none-eabihf", target = "thumbv7em-none-eabihf", features = [] },
|
|
{ name = "thumbv8m.base-none-eabi", target = "thumbv8m.base-none-eabi", features = [] },
|
|
{ name = "thumbv8m.main-none-eabi", target = "thumbv8m.main-none-eabi", features = [] },
|
|
{ name = "thumbv8m.main-none-eabihf", target = "thumbv8m.main-none-eabihf", features = [] },
|
|
]
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["std", "nightly", "defmt"]
|
|
|
|
[features]
|
|
default = []
|
|
std = ["critical-section/std"]
|
|
wasm = ["dep:wasm-bindgen", "dep:js-sys"]
|
|
|
|
# Enable nightly-only features
|
|
nightly = []
|
|
|
|
turbowakers = []
|
|
|
|
integrated-timers = ["dep:embassy-time"]
|
|
|
|
# Trace interrupt invocations with rtos-trace.
|
|
rtos-trace-interrupt = ["rtos-trace", "embassy-macros/rtos-trace-interrupt"]
|
|
|
|
[dependencies]
|
|
defmt = { version = "0.3", optional = true }
|
|
log = { version = "0.4.14", optional = true }
|
|
rtos-trace = { version = "0.1.2", optional = true }
|
|
|
|
futures-util = { version = "0.3.17", default-features = false }
|
|
embassy-macros = { version = "0.1.0", path = "../embassy-macros" }
|
|
embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true}
|
|
atomic-polyfill = "1.0.1"
|
|
critical-section = "1.1"
|
|
cfg-if = "1.0.0"
|
|
static_cell = "1.0"
|
|
|
|
# WASM dependencies
|
|
wasm-bindgen = { version = "0.2.82", optional = true }
|
|
js-sys = { version = "0.3", optional = true }
|