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
Summary:
Follow-ups to the buffered CallInvoker, kept out of that diff so the behavioural
change stays reviewable on its own. No behaviour change intended here.
- `BufferedRuntimeExecutor` gains `asRuntimeExecutor()` and
`asWeakRuntimeExecutor()`. RuntimeExecutor is a std::function, so callers
cannot hand it the object and instead each hand-rolled the same capturing
lambda; the ownership question now has one answer per lifetime policy. The
weak form is what `getBufferedRuntimeExecutor` needs, which must not keep the
instance alive.
- `BufferedWork` becomes private. It was only ever an implementation detail, and
being public put its fields in the C++ API snapshot.
- The buffer holds a `std::vector` sorted once at flush rather than a
`std::priority_queue`. Indices are handed out before the lock, so arrival
order can differ from submission order and something has to restore it — but a
heap is the expensive way. `std::priority_queue::top()` returns a const
reference, so every flushed item copied its `std::function` on the way out;
that copy is now a move, and nothing sifts on the way in.
- `runtimeExecutorThatGoesThroughRuntimeScheduler` was a second copy of
`getUnbufferedRuntimeExecutor()`; it now calls it.
- `RuntimeSchedulerCallInvoker` is marked deprecated. Its remaining users are
migrated: `ReactCxxPlatform` holds a `ReactInstance` and can use
`createJSCallInvoker()`, and four other files only `#include`d it without ever
constructing one. The single remaining use is the flag-off branch, which is
suppressed locally and goes when the flag is cleaned up.
- Drops a null check on `bufferedRuntimeExecutor_` in `callFunctionOnModule`
that the constructor makes unreachable.
Changelog:
[Internal]
Differential Revision: D118616045
0 commit comments