Last active
August 29, 2015 14:26
-
-
Save ghaiklor/f83961d73e1bca8515e3 to your computer and use it in GitHub Desktop.
NodeJS method that registers native module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void node_module_register(void* m) { | |
struct node_module* mp = reinterpret_cast<struct node_module*>(m); | |
if (mp->nm_flags & NM_F_BUILTIN) { | |
mp->nm_link = modlist_builtin; | |
modlist_builtin = mp; | |
} else if (!node_is_initialized) { | |
// "Linked" modules are included as part of the node project. | |
// Like builtins they are registered *before* node::Init runs. | |
mp->nm_flags = NM_F_LINKED; | |
mp->nm_link = modlist_linked; | |
modlist_linked = mp; | |
} else { | |
modpending = mp; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment