async-wrap: add provider id and object info cb
authorTrevor Norris <trev.norris@gmail.com>
Wed, 3 Jun 2015 21:31:33 +0000 (15:31 -0600)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 17 Jun 2015 18:58:39 +0000 (12:58 -0600)
commite56758a5e0ff6822e3105c0e69eb49accc42393c
tree25cc1ce181450f78f4dbce2a8d4489752c35cf7b
parent5d0cee46bb90084e6dcd584deb5bc893862ce3b3
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 <info@bnoordhuis.nl>
25 files changed:
src/async-wrap-inl.h
src/async-wrap.cc
src/async-wrap.h
src/cares_wrap.cc
src/fs_event_wrap.cc
src/js_stream.h
src/node.cc
src/node_crypto.cc
src/node_crypto.h
src/node_file.cc
src/node_stat_watcher.h
src/node_zlib.cc
src/pipe_wrap.cc
src/pipe_wrap.h
src/process_wrap.cc
src/signal_wrap.cc
src/stream_base-inl.h
src/stream_base.h
src/tcp_wrap.cc
src/tcp_wrap.h
src/timer_wrap.cc
src/tls_wrap.h
src/tty_wrap.h
src/udp_wrap.cc
src/udp_wrap.h