-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
- 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