-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
subsecond: Typed HotFn pointer #4153
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
Conversation
try_call_with_ptr should be unsafe if HotFnPtr is craftable outside Subsecond since you'd be able to pass arbitrary u64s in, so either we make it so HotFnPtr can only originate inside this crate or mark the method unsafe. I think I like marking the method unsafe more, but up to you. |
I think the cleaner API would be to make the |
I went with @janhohenheim suggestion! |
Also - if a HotFnPtr is around, it might be unsafe to use it if the framework has migrated structs. IE the layout of a function's argument changed, the old one is going to cause a segfault. It might be worth marking the call method unsafe too. |
* type the HotFn pointer * can reuse a HotFnPtr to run a hot patched function * unsafe constructor * try_call_with_ptr is unsafe
# Objective - Enable hot patching systems with subsecond - Fixes #19296 ## Solution - First commit is the naive thin layer - Second commit only check the jump table when the code is hot patched instead of on every system execution - Depends on DioxusLabs/dioxus#4153 for a nicer API, but could be done without - Everything in second commit is feature gated, it has no impact when the feature is not enabled ## Testing - Check dependencies without the feature enabled: nothing dioxus in tree - Run the new example: text and color can be changed --------- Co-authored-by: Jan Hohenheim <[email protected]> Co-authored-by: JMS55 <[email protected]>
ptr_address