apply_wprof_memory_floor

Function apply_wprof_memory_floor 

Source
pub fn apply_wprof_memory_floor(raw_mib: u32, wprof: bool) -> u32
Expand description

Apply the wprof memory floor to a raw memory size.

Returns WPROF_MIN_MEMORY_MIB when wprof is true and raw_mib falls below the floor; otherwise returns raw_mib unchanged. Pure function — no logging, no side effects — so it can be called from multiple resolution paths without duplicating the floor formula.

Single source of truth shared by crate::test_support::runtime::derive_test_memory_mib (the test-launch path used by cargo ktstr test) AND by cargo ktstr shell --test <NAME>’s router (which constructs a shell VM matching the named test’s topology). A future change to the floor formula updates here once; both call sites pick it up. Inline copies of the raw < WPROF_MIN_MEMORY_MIB conditional are a regression per the derive_test_memory_mib/attach_wprof_if_requested precedent.