Avoid heap-allocating background processor futures#4733
Conversation
Abeeujah
commented
Jun 20, 2026
|
I've assigned @valentinewallace as a reviewer! |
|
I've re-verified the full refactored block against the original behavior. The code matches my prior analysis: side-effect ordering, skipped-work semantics, eager CM poll, No new issues found beyond what I noted previously. The No issues found. |
Replace Box::pin with core::pin::pin! in process_events_async now that MSRV is 1.75. This eliminates a heap allocation per task on every loop iteration by pinning the futures directly to the stack. To satisfy lifetime and Joiner bounds, the loop logic was refactored to run synchronous timer checks first, using flags to conditionally execute the stack-pinned futures. Existing eager polling and early-break semantics are preserved.
|
🔔 1st Reminder Hey @valentinewallace! This PR has been waiting for your review. |