remove unnecessary memory allocation in SerialExecutor
Summary: SerialExecutor used to have public constructors and could be constructed on the heap or on the stack. In order to be able to reference the shared stater later from the parent executor, the task queue was implemented in a separate class, of which the SerialExecutor would create one, managed by a `shared_ptr`. With the recent move towards `folly::Executor::KeepAlive`, the SerialExecutor itself always has to be constructed on the heap (hence no public constructor anymore but factory functions). However, that means that we can embed the task queue implementation in SerialExecutor, using `KeepAlive` objects to access it from the parent executor. This change simplifies the implementation of SerialExecutor and reduces the number of heap objects and thus memory allocations. Reviewed By: andriigrynenko Differential Revision: D7927260 fbshipit-source-id: d3b6a2376bfdf512a946f2f45c730ed68176a441
Showing
Please register or sign in to comment