You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2018/06/11 13:47:49 UTC

[2/2] mesos git commit: Moved some constant definitions into header file.

Moved some constant definitions into header file.

Since we are using C++11 and the declared constants are either POD or
`constexpr` types, we can define them in the header as `constexpr`.
This also removes the need to declare the constants as `extern` which
should make using their headers easier (e.g., simpler linkage
requirements).

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


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

Branch: refs/heads/master
Commit: b1e88f73b06289466be5bdc8d8987d23c397110a
Parents: bff6fdf
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Mon Jun 11 15:39:54 2018 +0200
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Mon Jun 11 15:41:23 2018 +0200

----------------------------------------------------------------------
 3rdparty/libprocess/Makefile.am                 |  3 +--
 .../libprocess/include/process/timeseries.hpp   |  9 ++-----
 3rdparty/libprocess/src/CMakeLists.txt          |  3 +--
 3rdparty/libprocess/src/timeseries.cpp          | 26 --------------------
 4 files changed, 4 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b1e88f73/3rdparty/libprocess/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/Makefile.am b/3rdparty/libprocess/Makefile.am
index d434001..8910416 100644
--- a/3rdparty/libprocess/Makefile.am
+++ b/3rdparty/libprocess/Makefile.am
@@ -226,8 +226,7 @@ libprocess_la_SOURCES =		\
   src/subprocess.cpp		\
   src/subprocess_posix.cpp	\
   src/subprocess_posix.hpp	\
-  src/time.cpp			\
-  src/timeseries.cpp
+  src/time.cpp
 
 if ENABLE_SSL
 libprocess_la_SOURCES +=	\

http://git-wip-us.apache.org/repos/asf/mesos/blob/b1e88f73/3rdparty/libprocess/include/process/timeseries.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/timeseries.hpp b/3rdparty/libprocess/include/process/timeseries.hpp
index 64b10a8..1dda737 100644
--- a/3rdparty/libprocess/include/process/timeseries.hpp
+++ b/3rdparty/libprocess/include/process/timeseries.hpp
@@ -27,13 +27,8 @@
 namespace process {
 
 // Default statistic configuration variables.
-// TODO(bmahler): It appears there may be a bug with gcc-4.1.2 in
-// which these duration constants were not being initialized when
-// having static linkage. This issue did not manifest in newer gcc's.
-// Specifically, 4.2.1 was ok. So we've moved these to have external
-// linkage but perhaps in the future we can revert this.
-extern const Duration TIME_SERIES_WINDOW;
-extern const size_t TIME_SERIES_CAPACITY;
+constexpr Duration TIME_SERIES_WINDOW = Weeks(2);
+constexpr size_t TIME_SERIES_CAPACITY = 1000;
 
 
 // Provides an in-memory time series of statistics over some window.

http://git-wip-us.apache.org/repos/asf/mesos/blob/b1e88f73/3rdparty/libprocess/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/CMakeLists.txt b/3rdparty/libprocess/src/CMakeLists.txt
index cf443df..eb88afb 100644
--- a/3rdparty/libprocess/src/CMakeLists.txt
+++ b/3rdparty/libprocess/src/CMakeLists.txt
@@ -60,8 +60,7 @@ set(PROCESS_SRC
   socket.cpp
   socket_manager.hpp
   subprocess.cpp
-  time.cpp
-  timeseries.cpp)
+  time.cpp)
 
 if (WIN32)
   list(APPEND PROCESS_SRC

http://git-wip-us.apache.org/repos/asf/mesos/blob/b1e88f73/3rdparty/libprocess/src/timeseries.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/timeseries.cpp b/3rdparty/libprocess/src/timeseries.cpp
deleted file mode 100644
index 528adef..0000000
--- a/3rdparty/libprocess/src/timeseries.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License
-
-#include <stddef.h> // For size_t.
-
-#include <process/timeseries.hpp>
-
-#include <stout/duration.hpp>
-
-namespace process {
-
-// TODO(bmahler): Move these into timeseries.hpp header once we
-// can require gcc >= 4.2.1.
-const Duration TIME_SERIES_WINDOW = Weeks(2);
-const size_t TIME_SERIES_CAPACITY = 1000;
-
-}  // namespace process {