Skip to content

Commit

Permalink
src: add public API for managing NodePlatform
Browse files Browse the repository at this point in the history
PR-URL: #16981
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
zcbenz authored and MylesBorins committed Aug 7, 2018
1 parent d43b5da commit 2abfea0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4043,6 +4043,18 @@ void FreeEnvironment(Environment* env) {
}


MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,
v8::TracingController* tracing_controller) {
return new NodePlatform(thread_pool_size, tracing_controller);
}


void FreePlatform(MultiIsolatePlatform* platform) {
delete platform;
}


inline int Start(Isolate* isolate, IsolateData* isolate_data,
int argc, const char* const* argv,
int exec_argc, const char* const* exec_argv) {
Expand Down
10 changes: 10 additions & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
// Forward-declare libuv loop
struct uv_loop_s;

// Forward-declare TracingController, used by CreatePlatform.
namespace v8 {
class TracingController;
}

// Forward-declare these functions now to stop MSVS from becoming
// terminally confused when it's done in node_internals.h
namespace node {
Expand Down Expand Up @@ -243,6 +248,11 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data,
NODE_EXTERN void LoadEnvironment(Environment* env);
NODE_EXTERN void FreeEnvironment(Environment* env);

NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
int thread_pool_size,
v8::TracingController* tracing_controller);
NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform);

NODE_EXTERN void EmitBeforeExit(Environment* env);
NODE_EXTERN int EmitExit(Environment* env);
NODE_EXTERN void RunAtExit(Environment* env);
Expand Down

0 comments on commit 2abfea0

Please sign in to comment.