Loading libmemunreachable/HeapWalker.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ class HeapWalker { allocation_bytes_(0), allocation_bytes_(0), roots_(allocator), roots_(allocator), root_vals_(allocator), root_vals_(allocator), segv_handler_(allocator), segv_handler_(), walking_ptr_(0) { walking_ptr_(0) { valid_allocations_range_.end = 0; valid_allocations_range_.end = 0; valid_allocations_range_.begin = ~valid_allocations_range_.end; valid_allocations_range_.begin = ~valid_allocations_range_.end; Loading libmemunreachable/LeakFolding.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ void LeakFolding::ComputeDAG() { } } void LeakFolding::AccumulateLeaks(SCCInfo* dominator) { void LeakFolding::AccumulateLeaks(SCCInfo* dominator) { std::function<void(SCCInfo*)> walk(std::allocator_arg, allocator_, [&](SCCInfo* scc) { std::function<void(SCCInfo*)> walk([&](SCCInfo* scc) { if (scc->accumulator != dominator) { if (scc->accumulator != dominator) { scc->accumulator = dominator; scc->accumulator = dominator; dominator->cuumulative_size += scc->size; dominator->cuumulative_size += scc->size; Loading libmemunreachable/ScopedSignalHandler.h +2 −4 Original line number Original line Diff line number Diff line Loading @@ -32,15 +32,14 @@ class ScopedSignalHandler { public: public: using Fn = std::function<void(ScopedSignalHandler&, int, siginfo_t*, void*)>; using Fn = std::function<void(ScopedSignalHandler&, int, siginfo_t*, void*)>; explicit ScopedSignalHandler(Allocator<Fn> allocator) : allocator_(allocator), signal_(-1) {} explicit ScopedSignalHandler() : signal_(-1) {} ~ScopedSignalHandler() { reset(); } ~ScopedSignalHandler() { reset(); } template <class F> template <class F> void install(int signal, F&& f) { void install(int signal, F&& f) { if (signal_ != -1) MEM_LOG_ALWAYS_FATAL("ScopedSignalHandler already installed"); if (signal_ != -1) MEM_LOG_ALWAYS_FATAL("ScopedSignalHandler already installed"); handler_ = SignalFn(std::allocator_arg, allocator_, handler_ = SignalFn([=](int signal, siginfo_t* si, void* uctx) { f(*this, signal, si, uctx); }); [=](int signal, siginfo_t* si, void* uctx) { f(*this, signal, si, uctx); }); struct sigaction act {}; struct sigaction act {}; act.sa_sigaction = [](int signal, siginfo_t* si, void* uctx) { handler_(signal, si, uctx); }; act.sa_sigaction = [](int signal, siginfo_t* si, void* uctx) { handler_(signal, si, uctx); }; Loading Loading @@ -68,7 +67,6 @@ class ScopedSignalHandler { private: private: using SignalFn = std::function<void(int, siginfo_t*, void*)>; using SignalFn = std::function<void(int, siginfo_t*, void*)>; DISALLOW_COPY_AND_ASSIGN(ScopedSignalHandler); DISALLOW_COPY_AND_ASSIGN(ScopedSignalHandler); Allocator<Fn> allocator_; int signal_; int signal_; struct sigaction old_act_; struct sigaction old_act_; // TODO(ccross): to support multiple ScopedSignalHandlers handler_ would need // TODO(ccross): to support multiple ScopedSignalHandlers handler_ would need Loading Loading
libmemunreachable/HeapWalker.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -52,7 +52,7 @@ class HeapWalker { allocation_bytes_(0), allocation_bytes_(0), roots_(allocator), roots_(allocator), root_vals_(allocator), root_vals_(allocator), segv_handler_(allocator), segv_handler_(), walking_ptr_(0) { walking_ptr_(0) { valid_allocations_range_.end = 0; valid_allocations_range_.end = 0; valid_allocations_range_.begin = ~valid_allocations_range_.end; valid_allocations_range_.begin = ~valid_allocations_range_.end; Loading
libmemunreachable/LeakFolding.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -57,7 +57,7 @@ void LeakFolding::ComputeDAG() { } } void LeakFolding::AccumulateLeaks(SCCInfo* dominator) { void LeakFolding::AccumulateLeaks(SCCInfo* dominator) { std::function<void(SCCInfo*)> walk(std::allocator_arg, allocator_, [&](SCCInfo* scc) { std::function<void(SCCInfo*)> walk([&](SCCInfo* scc) { if (scc->accumulator != dominator) { if (scc->accumulator != dominator) { scc->accumulator = dominator; scc->accumulator = dominator; dominator->cuumulative_size += scc->size; dominator->cuumulative_size += scc->size; Loading
libmemunreachable/ScopedSignalHandler.h +2 −4 Original line number Original line Diff line number Diff line Loading @@ -32,15 +32,14 @@ class ScopedSignalHandler { public: public: using Fn = std::function<void(ScopedSignalHandler&, int, siginfo_t*, void*)>; using Fn = std::function<void(ScopedSignalHandler&, int, siginfo_t*, void*)>; explicit ScopedSignalHandler(Allocator<Fn> allocator) : allocator_(allocator), signal_(-1) {} explicit ScopedSignalHandler() : signal_(-1) {} ~ScopedSignalHandler() { reset(); } ~ScopedSignalHandler() { reset(); } template <class F> template <class F> void install(int signal, F&& f) { void install(int signal, F&& f) { if (signal_ != -1) MEM_LOG_ALWAYS_FATAL("ScopedSignalHandler already installed"); if (signal_ != -1) MEM_LOG_ALWAYS_FATAL("ScopedSignalHandler already installed"); handler_ = SignalFn(std::allocator_arg, allocator_, handler_ = SignalFn([=](int signal, siginfo_t* si, void* uctx) { f(*this, signal, si, uctx); }); [=](int signal, siginfo_t* si, void* uctx) { f(*this, signal, si, uctx); }); struct sigaction act {}; struct sigaction act {}; act.sa_sigaction = [](int signal, siginfo_t* si, void* uctx) { handler_(signal, si, uctx); }; act.sa_sigaction = [](int signal, siginfo_t* si, void* uctx) { handler_(signal, si, uctx); }; Loading Loading @@ -68,7 +67,6 @@ class ScopedSignalHandler { private: private: using SignalFn = std::function<void(int, siginfo_t*, void*)>; using SignalFn = std::function<void(int, siginfo_t*, void*)>; DISALLOW_COPY_AND_ASSIGN(ScopedSignalHandler); DISALLOW_COPY_AND_ASSIGN(ScopedSignalHandler); Allocator<Fn> allocator_; int signal_; int signal_; struct sigaction old_act_; struct sigaction old_act_; // TODO(ccross): to support multiple ScopedSignalHandlers handler_ would need // TODO(ccross): to support multiple ScopedSignalHandlers handler_ would need Loading