----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/26578/#review58919 -----------------------------------------------------------
3rdparty/libprocess/include/process/gc.hpp <https://reviews.apache.org/r/26578/#comment100096> This, IMHO, is a misleading/confusing use of unique_ptr, and a perfect opportunity to discuss how, and when, we want to use it in the code base. The reason this case is misleading is because 'process' is in no way "unique", in the sense that this pointer will be stored in lots of different structures throughout the libprocess library. What you're using unique_ptr for here is "automatic" memory management (although it's not so automatic because you're still calling 'reset') but that might give some people the illusion that they can use this pointer in such a way that nobody else can manipulate the object that is being pointed to because nobody else knows it. In this case it's easy to just use 'delete' where you're doing 'reset', but in other cases we should be very explicit about our use of unique_ptr and the semantics we want to convey to other readers of the code. 3rdparty/libprocess/include/process/gc.hpp <https://reviews.apache.org/r/26578/#comment100097> I'm not convinced these are a good semantics. The point of the garbage collector is to reclaim memory when a process terminates, but now we've also termianted processes when the garbage collector gets terminated! Making sure all processes are garbage (i.e., terminated) should be outside the scope of the responsibilities of the GarbageCollector. - Benjamin Hindman On Oct. 15, 2014, 9:37 p.m., Joris Van Remoortere wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/26578/ > ----------------------------------------------------------- > > (Updated Oct. 15, 2014, 9:37 p.m.) > > > Review request for mesos, Benjamin Hindman and Niklas Nielsen. > > > Repository: mesos-git > > > Description > ------- > > Implement the finalize() virtual override for Libprocess' garbage collector. > This terminates all processes registered with the garbage collector when the > garbage collector terminates. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/gc.hpp e83c636 > > Diff: https://reviews.apache.org/r/26578/diff/ > > > Testing > ------- > > make check > support/mesos-style.py > > > Thanks, > > Joris Van Remoortere > >
