Skip to content

Commit

Permalink
src: register external references of SignalWrap for snapshot
Browse files Browse the repository at this point in the history
PR-URL: #39961
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
joyeecheung authored and BethGriggs committed Sep 21, 2021
1 parent db75711 commit 6095fb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/node_external_reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ExternalReferenceRegistry {
V(serdes) \
V(string_decoder) \
V(stream_wrap) \
V(signal_wrap) \
V(trace_events) \
V(timers) \
V(types) \
Expand Down
9 changes: 9 additions & 0 deletions src/signal_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "async_wrap-inl.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "node_external_reference.h"
#include "node_process-inl.h"
#include "util-inl.h"
#include "v8.h"
Expand Down Expand Up @@ -62,6 +63,12 @@ class SignalWrap : public HandleWrap {
env->SetConstructorFunction(target, "Signal", constructor);
}

static void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
registry->Register(New);
registry->Register(Start);
registry->Register(Stop);
}

SET_NO_MEMORY_INFO()
SET_MEMORY_INFO_NAME(SignalWrap)
SET_SELF_SIZE(SignalWrap)
Expand Down Expand Up @@ -167,3 +174,5 @@ bool HasSignalJSHandler(int signum) {


NODE_MODULE_CONTEXT_AWARE_INTERNAL(signal_wrap, node::SignalWrap::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(signal_wrap,
node::SignalWrap::RegisterExternalReferences)

0 comments on commit 6095fb0

Please sign in to comment.