Re: Review Request 44191: Avoided external linkage for master constants.

2016-03-12 Thread Neil Conway


> On March 12, 2016, 2:21 a.m., Ben Mahler wrote:
> > src/master/constants.hpp, lines 127-128
> > 
> >
> > Any reason this Duration constant wasn't changed to constexpr?

This was an oversight on my part. Thanks for catching!


- Neil


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/#review123255
---


On March 11, 2016, 6:31 p.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44191/
> ---
> 
> (Updated March 11, 2016, 6:31 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-4790
> https://issues.apache.org/jira/browse/MESOS-4790
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We were only using external linkage to workaround bugs in ancient
> (4.1.x) of GCC. We can also mark most of these constants `constexpr`,
> which should be both slightly more efficient (in theory) and
> safer (see MESOS-1023).
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt e9f7c3a447aad79ab19d53879888a413a587408f 
>   src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
>   src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
>   src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 
> 
> Diff: https://reviews.apache.org/r/44191/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Note that I left a few string constants as `const std::string`; you might 
> arguably want them to be `constexpr char[]` (per Google Style Guide).
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44191: Avoided external linkage for master constants.

2016-03-11 Thread Ben Mahler

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/#review123255
---


Fix it, then Ship it!




We may want to update the description to say that the constexpr change is to 
bring it in-line with the latest style guidelines for the project. Initially 
when I read performance I thought we were trying to optimize something without 
a basis. :)


src/master/constants.hpp (lines 120 - 121)


Any reason this Duration constant wasn't changed to constexpr?


- Ben Mahler


On March 11, 2016, 6:31 p.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44191/
> ---
> 
> (Updated March 11, 2016, 6:31 p.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-4790
> https://issues.apache.org/jira/browse/MESOS-4790
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We were only using external linkage to workaround bugs in ancient
> (4.1.x) of GCC. We can also mark most of these constants `constexpr`,
> which should be both slightly more efficient (in theory) and
> safer (see MESOS-1023).
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt e9f7c3a447aad79ab19d53879888a413a587408f 
>   src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
>   src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
>   src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 
> 
> Diff: https://reviews.apache.org/r/44191/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Note that I left a few string constants as `const std::string`; you might 
> arguably want them to be `constexpr char[]` (per Google Style Guide).
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44191: Avoided external linkage for master constants.

2016-03-11 Thread Neil Conway

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/
---

(Updated March 11, 2016, 6:31 p.m.)


Review request for mesos and Ben Mahler.


Bugs: MESOS-4790
https://issues.apache.org/jira/browse/MESOS-4790


Repository: mesos


Description
---

We were only using external linkage to workaround bugs in ancient
(4.1.x) of GCC. We can also mark most of these constants `constexpr`,
which should be both slightly more efficient (in theory) and
safer (see MESOS-1023).


Diffs (updated)
-

  src/CMakeLists.txt e9f7c3a447aad79ab19d53879888a413a587408f 
  src/Makefile.am b24f0f58fa188c16770fe6a3c23ec06262cb0955 
  src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
  src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 

Diff: https://reviews.apache.org/r/44191/diff/


Testing
---

make check

Note that I left a few string constants as `const std::string`; you might 
arguably want them to be `constexpr char[]` (per Google Style Guide).


Thanks,

Neil Conway



Re: Review Request 44191: Avoided external linkage for master constants.

2016-03-11 Thread Neil Conway


> On March 11, 2016, 12:38 a.m., Ben Mahler wrote:
> > src/master/constants.hpp, line 108
> > 
> >
> > Could you also go ahead and do the change to `constexpr char[]` if 
> > possible for strings here?

Done, as a separate patch.


- Neil


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/#review123043
---


On March 1, 2016, 2:26 a.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44191/
> ---
> 
> (Updated March 1, 2016, 2:26 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-4790
> https://issues.apache.org/jira/browse/MESOS-4790
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We were only using external linkage to workaround bugs in ancient
> (4.1.x) of GCC. We can also mark most of these constants `constexpr`,
> which should be both slightly more efficient (in theory) and
> safer (see MESOS-1023).
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt a62042fbd45b46217a88098875524f93d3079de3 
>   src/Makefile.am 5d8fe8bf33acb352589b2b3e0341987f9a41bc17 
>   src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
>   src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 
> 
> Diff: https://reviews.apache.org/r/44191/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Note that I left a few string constants as `const std::string`; you might 
> arguably want them to be `constexpr char[]` (per Google Style Guide).
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44191: Avoided external linkage for master constants.

2016-03-10 Thread Ben Mahler

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/#review123043
---



Thanks! Are you planning to also address the slave's constants files?


src/master/constants.hpp (line 101)


Could you also go ahead and do the change to `constexpr char[]` if possible 
for strings here?


- Ben Mahler


On March 1, 2016, 2:26 a.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44191/
> ---
> 
> (Updated March 1, 2016, 2:26 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-4790
> https://issues.apache.org/jira/browse/MESOS-4790
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We were only using external linkage to workaround bugs in ancient
> (4.1.x) of GCC. We can also mark most of these constants `constexpr`,
> which should be both slightly more efficient (in theory) and
> safer (see MESOS-1023).
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt a62042fbd45b46217a88098875524f93d3079de3 
>   src/Makefile.am 5d8fe8bf33acb352589b2b3e0341987f9a41bc17 
>   src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
>   src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 
> 
> Diff: https://reviews.apache.org/r/44191/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Note that I left a few string constants as `const std::string`; you might 
> arguably want them to be `constexpr char[]` (per Google Style Guide).
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44191: Avoided external linkage for master constants.

2016-02-29 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/#review121391
---



Patch looks great!

Reviews applied: [44190, 44191]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On March 1, 2016, 2:26 a.m., Neil Conway wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44191/
> ---
> 
> (Updated March 1, 2016, 2:26 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-4790
> https://issues.apache.org/jira/browse/MESOS-4790
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> We were only using external linkage to workaround bugs in ancient
> (4.1.x) of GCC. We can also mark most of these constants `constexpr`,
> which should be both slightly more efficient (in theory) and
> safer (see MESOS-1023).
> 
> 
> Diffs
> -
> 
>   src/CMakeLists.txt a62042fbd45b46217a88098875524f93d3079de3 
>   src/Makefile.am 5d8fe8bf33acb352589b2b3e0341987f9a41bc17 
>   src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
>   src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 
> 
> Diff: https://reviews.apache.org/r/44191/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Note that I left a few string constants as `const std::string`; you might 
> arguably want them to be `constexpr char[]` (per Google Style Guide).
> 
> 
> Thanks,
> 
> Neil Conway
> 
>



Re: Review Request 44191: Avoided external linkage for master constants.

2016-02-29 Thread Neil Conway

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/
---

(Updated March 1, 2016, 2:26 a.m.)


Review request for mesos and Ben Mahler.


Bugs: MESOS-4790
https://issues.apache.org/jira/browse/MESOS-4790


Repository: mesos


Description
---

We were only using external linkage to workaround bugs in ancient
(4.1.x) of GCC. We can also mark most of these constants `constexpr`,
which should be both slightly more efficient (in theory) and
safer (see MESOS-1023).


Diffs
-

  src/CMakeLists.txt a62042fbd45b46217a88098875524f93d3079de3 
  src/Makefile.am 5d8fe8bf33acb352589b2b3e0341987f9a41bc17 
  src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
  src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 

Diff: https://reviews.apache.org/r/44191/diff/


Testing (updated)
---

make check

Note that I left a few string constants as `const std::string`; you might 
arguably want them to be `constexpr char[]` (per Google Style Guide).


Thanks,

Neil Conway



Review Request 44191: Avoided external linkage for master constants.

2016-02-29 Thread Neil Conway

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44191/
---

Review request for mesos and Ben Mahler.


Bugs: MESOS-4790
https://issues.apache.org/jira/browse/MESOS-4790


Repository: mesos


Description
---

We were only using external linkage to workaround bugs in ancient
(4.1.x) of GCC. We can also mark most of these constants `constexpr`,
which should be both slightly more efficient (in theory) and
safer (see MESOS-1023).


Diffs
-

  src/CMakeLists.txt a62042fbd45b46217a88098875524f93d3079de3 
  src/Makefile.am 5d8fe8bf33acb352589b2b3e0341987f9a41bc17 
  src/master/constants.hpp 2c3299bc1aaa0888f7e47a71965c56ada8ecc21f 
  src/master/constants.cpp e316f9772d880b694faeee6d001dc56bc088c118 

Diff: https://reviews.apache.org/r/44191/diff/


Testing
---

make check


Thanks,

Neil Conway