Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

阅读node源码时的一个问题(关于ExternalReference) #11

Closed
tain335 opened this issue Jan 25, 2021 · 1 comment
Closed

阅读node源码时的一个问题(关于ExternalReference) #11

tain335 opened this issue Jan 25, 2021 · 1 comment

Comments

@tain335
Copy link

tain335 commented Jan 25, 2021

我发现有些内部模块是需要注册外部引用的
NODE_MODULE_CONTEXT_AWARE_INTERNAL(buffer, node::Buffer::Initialize) NODE_MODULE_EXTERNAL_REFERENCE(buffer, node::Buffer::RegisterExternalReferences)

但是有些内部模块就不需要了
NODE_MODULE_CONTEXT_AWARE_INTERNAL(fs, node::fs::Initialize)

不知道这是为什么,我查阅了一些文档应该是所有绑定的c++函数都应该注册外部引用,然后从snapshot启动的时候也需要提供这些引用才可以,但是这里源码却有的模块可以不提供,我感觉应该是有些地方还没有注意到,希望博主能解答一下

@XadillaX
Copy link
Owner

XadillaX commented Mar 1, 2021

nodejs/node#32984

@XadillaX XadillaX closed this as completed Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants