> On July 1, 2015, 9:46 p.m., Timothy Chen wrote:
> > src/linux/cgroups.cpp, line 2014
> > <https://reviews.apache.org/r/36106/diff/1/?file=997647#file997647line2014>
> >
> >     I don't think we usually define a inline function like this anywhere 
> > else, so curious to see what others think.
> >     Personally I don't think it provides any additional benefits here.
> 
> Jojy Varghese wrote:
>     The advantage is that otherwise we will end up copy-paste code of parsing 
> at two places(line 0 and line 1)
> 
> Timothy Chen wrote:
>     What I meant to compare with is having a another named function defined.
> 
> Jojy Varghese wrote:
>     Having an external function is useful if its being used outside this 
> function. Anonymous functions are meant to solve this.
> 
> Timothy Chen wrote:
>     No one else chimed in then I guess it's fine, I don't have any particular 
> setback around this but this is most likely the first introduction of this. I 
> won't be suprised if some other committer jumps on this.

After adding lambda support, we can finally do things like this (YAY!)
See the `Feel free to use auto when naming a lambda expression:` section of the 
[style 
guide](http://mesos.apache.org/documentation/latest/mesos-c++-style-guide/)

Specifically, if the function is not mutating local state, but rather 
represents a functional transformation this is a nice use of a lambda.


- Joris


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


On July 6, 2015, 6:20 p.m., Jojy Varghese wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36106/
> -----------------------------------------------------------
> 
> (Updated July 6, 2015, 6:20 p.m.)
> 
> 
> Review request for mesos, Ian Downes, Jie Yu, Joris Van Remoortere, and 
> Timothy Chen.
> 
> 
> Bugs: MESOS-2961
>     https://issues.apache.org/jira/browse/MESOS-2961
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> cgroups implementation does not have a cpuacct subsystem implementation as of
> today. Adding the implementation for stat function.
> 
> Changes:
>   - added Stats class to encapsulate cpuacct.stat data
>   - added implementation for cpuacct::stats
>   - added unit tests
> 
> Jira: MESOS-2961
> 
> 
> Diffs
> -----
> 
>   src/linux/cgroups.hpp 73b98317880eea3d6a2ba37ac56d1f7e3600ba94 
>   src/linux/cgroups.cpp 4c006d0c7382b940a83359d636c0d48952cdbb00 
>   src/tests/cgroups_tests.cpp 475f48a474eea708f98d8c0300862351a2d4379a 
> 
> Diff: https://reviews.apache.org/r/36106/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jojy Varghese
> 
>

Reply via email to