You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FutureObj requires a static vtable in the form of trait UnsafeFutureObj, this blocks being able to provide a conversion from Box<dyn Future<Output = ()>> to FutureObj<'static, ()> which would be useful for more optimized spawning.
I think one way to handle this would be to change FutureObj to directly contain a fat-pointer for the future + a function pointer for how to drop it (which can be statically determined by the concrete type containing the dyn Future when it's being converted to the FutureObj). That should be the same size as the existing implementation as the current poll_fn pointer is being replaced with the vtable pointer in the dyn Future. I guess it will require one more pointer lookup to find the poll_fn pointer in the vtable though...
FutureObj
requires a static vtable in the form oftrait UnsafeFutureObj
, this blocks being able to provide a conversion fromBox<dyn Future<Output = ()>>
toFutureObj<'static, ()>
which would be useful for more optimized spawning.I think one way to handle this would be to change
FutureObj
to directly contain a fat-pointer for the future + a function pointer for how to drop it (which can be statically determined by the concrete type containing thedyn Future
when it's being converted to theFutureObj
). That should be the same size as the existing implementation as the currentpoll_fn
pointer is being replaced with the vtable pointer in thedyn Future
. I guess it will require one more pointer lookup to find thepoll_fn
pointer in the vtable though...The text was updated successfully, but these errors were encountered: