You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2017/12/05 19:16:12 UTC

[3/3] mesos git commit: Reduced # of supported arguments in `_Deferred` conversion operators.

Reduced # of supported arguments in `_Deferred` conversion operators.

Conversion of `_Deferred` to `std::function` and `Deferred` currently
supports up to 12 parameters in function signature. However, this is
unnecessary and is a huge overhead. Most usages require just one
parameter (e.g. when `defer` is used with `Future`). And there are few
usages with two parameters (in `master.cpp` to initialize allocator, and
in `slave.cpp` to install signal handler). This number of parameters is
different from the number of parameters passed to `defer`, but it's
related and can be defined as maximum number of placeholders that can be
passed to `defer`.

Given that `deferred.hpp` is indirectly included in most source files,
it is beneficial to keep this number low. This patch changes maximum
number of parameters to 2.

Review: https://reviews.apache.org/r/64338/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/62b47273
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/62b47273
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/62b47273

Branch: refs/heads/master
Commit: 62b4727310873e80c82516971150082924d9075a
Parents: 13eda27
Author: Dmitry Zhuk <dz...@twopensource.com>
Authored: Tue Dec 5 11:04:00 2017 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Tue Dec 5 11:04:00 2017 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/deferred.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/62b47273/3rdparty/libprocess/include/process/deferred.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/deferred.hpp b/3rdparty/libprocess/include/process/deferred.hpp
index dfce0b9..8beb2b3 100644
--- a/3rdparty/libprocess/include/process/deferred.hpp
+++ b/3rdparty/libprocess/include/process/deferred.hpp
@@ -182,7 +182,7 @@ struct _Deferred
         });                                                              \
   }
 
-  REPEAT_FROM_TO(1, 13, TEMPLATE, _) // Args A0 -> A11.
+  REPEAT_FROM_TO(1, 3, TEMPLATE, _) // Args A0 -> A1.
 #undef TEMPLATE
 
 #define TEMPLATE(Z, N, DATA)                                            \
@@ -224,7 +224,7 @@ struct _Deferred
         });                                                             \
   }
 
-  REPEAT_FROM_TO(1, 13, TEMPLATE, _) // Args A0 -> A11.
+  REPEAT_FROM_TO(1, 3, TEMPLATE, _) // Args A0 -> A1.
 #undef TEMPLATE
 
 private: