diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-06-10 17:40:13 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-07-13 20:53:15 +0300 |
commit | 57e301539bff2599974b7269a56377330c9b730e (patch) | |
tree | 6f5c866728f22bbacb8dadb89a2c8a12e5b66508 /src/node_serdes.cc | |
parent | 36cc5f5caf52af895079d153a9131fe2b0c6b8f9 (diff) |
src: enable more detailed memory tracking
This will enable more detailed heap snapshots based on
a newer V8 API.
This commit itself is not tied to that API and could
be backported.
PR-URL: https://github.com/nodejs/node/pull/21742
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_serdes.cc')
-rw-r--r-- | src/node_serdes.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 520b3501992..4b2cc60b3f7 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -52,6 +52,11 @@ class SerializerContext : public BaseObject, static void WriteUint64(const FunctionCallbackInfo<Value>& args); static void WriteDouble(const FunctionCallbackInfo<Value>& args); static void WriteRawBytes(const FunctionCallbackInfo<Value>& args); + + void MemoryInfo(MemoryTracker* tracker) const override { + tracker->TrackThis(this); + } + private: ValueSerializer serializer_; }; @@ -76,6 +81,11 @@ class DeserializerContext : public BaseObject, static void ReadUint64(const FunctionCallbackInfo<Value>& args); static void ReadDouble(const FunctionCallbackInfo<Value>& args); static void ReadRawBytes(const FunctionCallbackInfo<Value>& args); + + void MemoryInfo(MemoryTracker* tracker) const override { + tracker->TrackThis(this); + } + private: const uint8_t* data_; const size_t length_; |