-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: standardise context embedder indices
PR-URL: #19135 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
- Loading branch information
Showing
7 changed files
with
45 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef SRC_NODE_CONTEXT_DATA_H_ | ||
#define SRC_NODE_CONTEXT_DATA_H_ | ||
|
||
namespace node { | ||
|
||
// Pick an index that's hopefully out of the way when we're embedded inside | ||
// another application. Performance-wise or memory-wise it doesn't matter: | ||
// Context::SetAlignedPointerInEmbedderData() is backed by a FixedArray, | ||
// worst case we pay a one-time penalty for resizing the array. | ||
#ifndef NODE_CONTEXT_EMBEDDER_DATA_INDEX | ||
#define NODE_CONTEXT_EMBEDDER_DATA_INDEX 32 | ||
#endif | ||
|
||
#ifndef NODE_CONTEXT_SANDBOX_OBJECT_INDEX | ||
#define NODE_CONTEXT_SANDBOX_OBJECT_INDEX 33 | ||
#endif | ||
|
||
enum ContextEmbedderIndex { | ||
kEnvironment = NODE_CONTEXT_EMBEDDER_DATA_INDEX, | ||
kSandboxObject = NODE_CONTEXT_SANDBOX_OBJECT_INDEX, | ||
}; | ||
|
||
} // namespace node | ||
|
||
#endif // SRC_NODE_CONTEXT_DATA_H_ |
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
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
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
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