From e56758a5e0ff6822e3105c0e69eb49accc42393c Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Wed, 3 Jun 2015 15:31:33 -0600 Subject: async-wrap: add provider id and object info cb Re-add the wrapper class id to AsyncWrap instances so they can be tracked directly in a heapdump. Previously the class id was given without setting the heap dump wrapper class info provider. Causing a segfault when a heapdump was taken. This has been added, and the label_ set to the given provider name so each instance can be identified. The id will not be set of the passed object has no internal field count. As the class pointer cannot be retrieved from the object. In order to properly report the allocated size of each class, the new pure virtual method self_size() has been introduces. PR-URL: https://github.com/nodejs/io.js/pull/1896 Reviewed-By: Ben Noordhuis --- src/signal_wrap.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/signal_wrap.cc') diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index 7cceb64560..4811aca53a 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -40,6 +40,8 @@ class SignalWrap : public HandleWrap { constructor->GetFunction()); } + size_t self_size() const override { return sizeof(*this); } + private: static void New(const FunctionCallbackInfo& args) { // This constructor should not be exposed to public javascript. -- cgit v1.2.3