> On Oct. 22, 2014, 9:23 a.m., Niklas Nielsen wrote: > > src/examples/test_module.hpp, lines 51-52 > > <https://reviews.apache.org/r/26906/diff/7/?file=728685#file728685line51> > > > > Why not just return the string directly? > > > > return "TestModule" > > Niklas Nielsen wrote: > Ah - never mind. It is because you return a pointer and the string needs > to reside somewhere :-/
Reopening - returning "TestModule" will not give you an address on the stack but a pointer to the string in the data segment. You should be fine returning directly instead of having it backed by a static. - Niklas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/26906/#review57808 ----------------------------------------------------------- On Oct. 22, 2014, 10:39 a.m., Kapil Arya wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/26906/ > ----------------------------------------------------------- > > (Updated Oct. 22, 2014, 10:39 a.m.) > > > Review request for mesos, Benjamin Hindman and Niklas Nielsen. > > > Repository: mesos-git > > > Description > ------- > > Introduced a new kind<T>() function that returns the string representation of > the module "kind". This function is specialized for each module "kind". Also > introduced a templatized contains<T>(moduleName) that returns true only if a > module of name "moduleName" and kind "T" is available. > > > Diffs > ----- > > include/mesos/module.hpp 5205e30c7b8228eced9793aef2348930180811bb > src/examples/test_module.hpp b5cc2fa9147c4fe9a1f2eb3e8c2c2565ea7f7420 > src/module/manager.hpp 1c93ac4707e3c5dc8acaaa23861b62d3d3921125 > src/tests/module_tests.cpp e92d8717427e259b1fa26b3f17719fd616a748c7 > > Diff: https://reviews.apache.org/r/26906/diff/ > > > Testing > ------- > > Added a new test and ran make check. > > > Thanks, > > Kapil Arya > >
