diff --git a/src/node_messaging.cc b/src/node_messaging.cc index b51607cc0ee371..f55cb7ed9bd08c 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -927,6 +927,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 054521b0563c42..d64bf23e086d05 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -192,10 +192,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 045fcc74a3a2f6..eeed824f66dee9 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -709,6 +709,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 5511e0f1a2eb4a..863e2cffde0f36 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -40,13 +40,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)