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

feat(isolate): guarantee OwnedIsolate layout #1641

Closed
wants to merge 1 commit into from

Conversation

LeoDog896
Copy link

uses repr(transparent) to ensure OwnedIsolate is a genuine wrapper.

uses repr(transparent) to ensure OwnedIsolate is a genuine wrapper.
@CLAassistant
Copy link

CLAassistant commented Oct 13, 2024

CLA assistant check
All committers have signed the CLA.

@devsnek
Copy link
Member

devsnek commented Oct 13, 2024

This just contains a pointer to the isolate, why does it need a repr?

@littledivy
Copy link
Member

@devsnek In Deno, we do *mut OwnedIsolate as *mut Isolate in some places

@devsnek
Copy link
Member

devsnek commented Oct 13, 2024

@littledivy that's not correct. OwnedIsolate implements deref to Isolate methods, which could then be casted from references to pointers without the type cast.

@littledivy
Copy link
Member

Oh you are right, we do &mut owned_isolate as *mut Isolate which does derefmut

@LeoDog896
Copy link
Author

I made the same assumption as @littledivy did earlier - I didn't notice this was guaranteed in DerefMut.

@devsnek devsnek closed this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants