diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 1028da69b44961..ebad6c67508105 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -900,6 +900,10 @@ void MessagePort::Entangle(MessagePort* a, MessagePortData* b) { MessagePortData::Entangle(a->data_.get(), b); } +void MessagePort::MemoryInfo(MemoryTracker* tracker) const { + tracker->TrackField("data", data_); +} + Local GetMessagePortConstructorTemplate(Environment* env) { // Factor generating the MessagePort JS constructor into its own piece // of code, because it is needed early on in the child environment setup. diff --git a/src/node_messaging.h b/src/node_messaging.h index 526158e144d354..6d2410a7248b95 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -191,10 +191,7 @@ class MessagePort : public HandleWrap { // NULL pointer to the C++ MessagePort object is also detached. inline bool IsDetached() const; - void MemoryInfo(MemoryTracker* tracker) const override { - tracker->TrackField("data", data_); - } - + void MemoryInfo(MemoryTracker* tracker) const override; SET_MEMORY_INFO_NAME(MessagePort) SET_SELF_SIZE(MessagePort) diff --git a/src/node_worker.cc b/src/node_worker.cc index b6f8df1a8b1db2..785f2783c22346 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -656,6 +656,10 @@ void Worker::Exit(int code) { } } +void Worker::MemoryInfo(MemoryTracker* tracker) const { + tracker->TrackField("parent_port", parent_port_); +} + namespace { // Return the MessagePort that is global for this Environment and communicates diff --git a/src/node_worker.h b/src/node_worker.h index 6db7b258ebd81a..f84362f35c1897 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -39,13 +39,10 @@ class Worker : public AsyncWrap { // Wait for the worker thread to stop (in a blocking manner). void JoinThread(); - void MemoryInfo(MemoryTracker* tracker) const override { - tracker->TrackField("parent_port", parent_port_); - } - template inline bool RequestInterrupt(Fn&& cb); + void MemoryInfo(MemoryTracker* tracker) const override; SET_MEMORY_INFO_NAME(Worker) SET_SELF_SIZE(Worker)