From: Matt Corallo Date: Tue, 13 Feb 2024 22:08:55 +0000 (+0000) Subject: Give `Future`s for a `FutureState` an idx and track `StdWaker` idxn X-Git-Tag: v0.0.123-beta~64^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;ds=sidebyside;h=5f404b9d0a0a160aa305b5a9421026e58c7ef609;hp=5f404b9d0a0a160aa305b5a9421026e58c7ef609;p=rust-lightning Give `Future`s for a `FutureState` an idx and track `StdWaker` idxn When an `std::future::Future` is `poll()`ed, we're only supposed to use the latest `Waker` provided. However, we currently push an `StdWaker` onto our callback list every time `poll` is called, waking every `Waker` but also using more and more memory until the `Future` itself is woken. Here we take a step towards fixing this by giving each `Future` a unique index and storing which `Future` an `StdWaker` came from in the callback list. This sets us up to deduplicate `StdWaker`s by `Future`s in the next commit. ---