Skip to content

Conversation

@coolreader18
Copy link
Contributor

Currently, IsolateHandle is unsound - it mutates IsolateAnnex.isolate through an immutable reference with no UnsafeCell. A much cleaner solution is to store the data for IsolateHandle in its own allocation, since that also means an extant IsolateHandle won't prevent the other data in IsolateAnnex from being deallocated. I originally was going to store the pointer to IsolateHandleInner in its own isolate data slot, but realized it was also possible to just still store it in IsolateAnnex for simplicity.

@coolreader18
Copy link
Contributor Author

coolreader18 commented Dec 17, 2025

I suppose another option is to not have any extra Arc indirection and just store a Weak<IsolateAnnex> in IsolateHandle, but then you don't get the unsynchronized access of IsolateHandle::get_isolate_ptr for Globals.

@coolreader18 coolreader18 force-pushed the split-isolateptr-from-annex branch from 0a5f530 to f0299f2 Compare December 17, 2025 20:58
@coolreader18 coolreader18 force-pushed the split-isolateptr-from-annex branch from f0299f2 to c58c1ae Compare December 17, 2025 21:11
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.

1 participant