Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: attach CppHeap to an v8::Isolate with isolate params #53038

Closed
wants to merge 1 commit into from

Conversation

legendecas
Copy link
Member

Create a CppHeap in the NodeMainInstance instead and attach the
CppHeap with Isolate::CreateParams. Existing cppgc addon tests
should continue to work wihtout change.

Fixes: #52718

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 17, 2024
Create a `CppHeap` in the `NodeMainInstance` instead and attach the
`CppHeap` with `Isolate::CreateParams`. Existing cppgc addon tests
should continue to work wihtout change.
@@ -44,6 +44,7 @@ class TransferData;
class BaseObject : public MemoryRetainer {
public:
enum InternalFields { kEmbedderType, kSlot, kInternalFieldCount };
constexpr static uint16_t kDefaultCppGCEmebdderTypeID = 0x90de;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constexpr static uint16_t kDefaultCppGCEmebdderTypeID = 0x90de;
constexpr static uint16_t kDefaultCppGCEmbedderTypeID = 0x90de;

{},
WrapperDescriptor(BaseObject::kEmbedderType,
BaseObject::kSlot,
BaseObject::kDefaultCppGCEmebdderTypeID)})),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are embedders expected to get the correct values such as kDefaultCppGCEmebdderTypeID? Shouldn't this be part of NewIsolate() or SetIsolateCreateParamsForNode()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, wrapper descriptors are going to be deprecated so that embedders don't have to care about what the value is: nodejs/node-v8#283.

Read more at https://docs.google.com/document/d/1-sBltmlx4yUIzmNHrRO9lKjqiN-uJ81gCmj9-Gq5d5w/edit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then this will 'just' attach a CppHeap with default options in the future anyway? That still feels like NewIsolate() or SetIsolateCreateParamsForNode() would be the right places for this, as the goal is to initialize a 'Node.js-flavored' Isolate instance, unless I'm missing something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I turned this into a draft because I think the current form is not complete.

@legendecas
Copy link
Member Author

Closed in favor of nodejs/node-v8#284

@legendecas legendecas closed this May 20, 2024
@legendecas legendecas deleted the cpp-heap branch May 20, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v8::Isolate::AttachCppHeap is deprecated
3 participants