pub struct TierExecutorBacking<const N: usize> { /* private fields */ }Expand description
issue 1571 — the spawned tiers’ executor backing, N slots in ONE named
static that the ENTRY owns.
nros::main! emits one per tiered entry, with N = the tier count minus the
boot tier (which takes the EXECUTOR_BACKING road), and passes
take to the board’s run_tiers. The board then refuses a
short block with check_tier_executor_backing — the Rust twin of the C
library’s nros_cpp_executor_storage_check.
Placement is the caller’s (RFC-0002 § 4.4b): the static lives in the entry’s
.bss, so mem-report prices it by name.
Implementations§
Source§impl<const N: usize> TierExecutorBacking<N>
impl<const N: usize> TierExecutorBacking<N>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
An untouched reservation. const so it can initialise a static, and
uninitialised (plus a false latch), so the static is all-zero .bss
and costs no flash.
large_stack_arrays is allowed because this is only ever evaluated in
CONST context (a static initialiser): the array is built by the
compiler into .bss, never on a stack.
Sourcepub fn take(&'static self) -> &'static mut [TierExecutorBackingSlot] ⓘ
pub fn take(&'static self) -> &'static mut [TierExecutorBackingSlot] ⓘ
Hand out every slot, once. A second call returns an EMPTY slice, which
the board’s check_tier_executor_backing then refuses by name rather
than aliasing a slot another executor is using.
mut_from_ref is the point, not an accident: &'static self is how a
static is reached, and the latch is what makes the one &mut sound —
the same shape as the boot reservation’s take.