Skip to content

Commit

Permalink
src: register external references in os bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Sep 28, 2021
1 parent 9bf7401 commit 7b08db1
Show file tree
Hide file tree
Showing 2 changed files with 17 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 @@ -62,6 +62,7 @@ class ExternalReferenceRegistry {
V(heap_utils) \
V(messaging) \
V(native_module) \
V(os) \
V(performance) \
V(process_methods) \
V(process_object) \
Expand Down
16 changes: 16 additions & 0 deletions src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,23 @@ void Initialize(Local<Object> target,
Boolean::New(env->isolate(), IsBigEndian())).Check();
}

void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
registry->Register(GetHostname);
registry->Register(GetLoadAvg);
registry->Register(GetUptime);
registry->Register(GetTotalMemory);
registry->Register(GetFreeMemory);
registry->Register(GetCPUInfo);
registry->Register(GetInterfaceAddresses);
registry->Register(GetHomeDirectory);
registry->Register(GetUserInfo);
registry->Register(SetPriority);
registry->Register(GetPriority);
registry->Register(GetOSInformation);
}

} // namespace os
} // namespace node

NODE_MODULE_CONTEXT_AWARE_INTERNAL(os, node::os::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(os, node::os::RegisterExternalReferences)

0 comments on commit 7b08db1

Please sign in to comment.