Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 71f8f12

Browse filesBrowse files
helloshuangziMylesBorins
authored andcommitted
src: add public API to expose the main V8 Platform
Add an API to get MultiIsolatePlatform used in node main thread. PR-URL: #20447 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 972b94e commit 71f8f12
Copy full SHA for 71f8f12

File tree

Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4439,6 +4439,11 @@ void FreeEnvironment(Environment* env) {
44394439
}
44404440

44414441

4442+
MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
4443+
return v8_platform.Platform();
4444+
}
4445+
4446+
44424447
MultiIsolatePlatform* CreatePlatform(
44434448
int thread_pool_size,
44444449
v8::TracingController* tracing_controller) {
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ NODE_EXTERN Environment* CreateEnvironment(IsolateData* isolate_data,
251251
NODE_EXTERN void LoadEnvironment(Environment* env);
252252
NODE_EXTERN void FreeEnvironment(Environment* env);
253253

254+
// This returns the MultiIsolatePlatform used in the main thread of Node.js.
255+
// If NODE_USE_V8_PLATFORM haven't been defined when Node.js was built,
256+
// it returns nullptr.
257+
NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform();
258+
254259
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
255260
int thread_pool_size,
256261
v8::TracingController* tracing_controller);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.