> On May 18, 2016, 5:35 p.m., Jojy Varghese wrote: > > 3rdparty/stout/include/stout/elf.hpp, line 56 > > <https://reviews.apache.org/r/47482/diff/2/?file=1386349#file1386349line56> > > > > Wondering why the implementation is in the header file.
For better or worse, stout is a header-only library. The implementation of all classes / functions are in header files. > On May 18, 2016, 5:35 p.m., Jojy Varghese wrote: > > 3rdparty/stout/include/stout/elf.hpp, line 63 > > <https://reviews.apache.org/r/47482/diff/2/?file=1386349#file1386349line63> > > > > Its recommended to use a smart pointer here. They provide the RAII > > property that you need here. Also, the pattern in Mesos is to use factory > > methods that return a `Owned`. `Owner` doesn't exist in stout. As I mentioned in response to your comment above about "Dont we have to close the open file in error cases?", I tried using a `std::unique_ptr` here, but it doesn't play nicely with `Try<>`. If you have any other suggestions, I'd love to hear them. Maybe it's worth adding a comment in the code somehwere about the limitations I encountered. > On May 18, 2016, 5:35 p.m., Jojy Varghese wrote: > > 3rdparty/stout/include/stout/elf.hpp, line 188 > > <https://reviews.apache.org/r/47482/diff/2/?file=1386349#file1386349line188> > > > > The advantage of emplace_back here would be that the `string` object > > will be created only once as opposed to being first created and then copied. OK, good to know. - Kevin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47482/#review133770 ----------------------------------------------------------- On May 18, 2016, 3:16 a.m., Kevin Klues wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47482/ > ----------------------------------------------------------- > > (Updated May 18, 2016, 3:16 a.m.) > > > Review request for mesos and Benjamin Mahler. > > > Bugs: MESOS-5400 > https://issues.apache.org/jira/browse/MESOS-5400 > > > Repository: mesos > > > Description > ------- > > Right now we are able to parse ELF formatted shared libraries and > extract their canonical SONAME and external library dependencies. In > the future, we should add support for fully parsing an ELf file for > easy access to all of its contents. > > The current implementation relies on libelf. We should probably remove > this dependency in future versions (mostly since the headers for > libelf are not installed on a standard Linux distribution by default). > > > Diffs > ----- > > 3rdparty/stout/configure.ac ada1e22c72875fe9d557f07e4846128be0bcef13 > 3rdparty/stout/include/stout/elf.hpp PRE-CREATION > > Diff: https://reviews.apache.org/r/47482/diff/ > > > Testing > ------- > > > Thanks, > > Kevin Klues > >
