Commit caa3c6ee authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Pass context by reference in the futures Core

Summary: [Folly] Pass context by reference in the futures `Core`, saving on code size and a small on runtime performance due to code size.

Reviewed By: Orvid

Differential Revision: D15073282

fbshipit-source-id: 7c55b9f6a55ee7ec22fde6f3ab9da232a8ee006b
parent dbac4430
...@@ -303,7 +303,7 @@ class Core final { ...@@ -303,7 +303,7 @@ class Core final {
/// and might also synchronously execute that callback (e.g., if there is no /// and might also synchronously execute that callback (e.g., if there is no
/// executor or if the executor is inline). /// executor or if the executor is inline).
template <typename F> template <typename F>
void setCallback(F&& func, std::shared_ptr<folly::RequestContext> context) { void setCallback(F&& func, std::shared_ptr<folly::RequestContext>&& context) {
DCHECK(!hasCallback()); DCHECK(!hasCallback());
// construct callback_ first; if that fails, context_ will not leak // construct callback_ first; if that fails, context_ will not leak
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment