You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: make guest dispatch API version-resilient
- Rename guest_dispatch_function to guest_dispatch_function_v2 to force
linker errors for out-of-date downstream code
- Add guest_dispatch! macro so users don't define the symbol by hand;
future signature changes will produce compile errors automatically
- Parameterize GuestFunctionDefinition<F: Copy> over the function
pointer type, eliminating transmutes in the C API dispatch path
- Remove redundant clone in print_output_with_host_print now that
FunctionCall is passed by value
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
4
5
5
## [Prerelease] - Unreleased
6
6
7
+
### Changed
8
+
***Breaking:** Change `guest_dispatch_function` signature by @ludfjig in https://github.com/hyperlight-dev/hyperlight/pull/1241
9
+
- The fallback dispatch function now receives `FunctionCall` by value instead of by reference.
10
+
- Rename `guest_dispatch_function` to `guest_dispatch_function_v2` and change the signature from `fn(fc: &FunctionCall) -> Result<Vec<u8>>` to `fn(fc: FunctionCall) -> Result<Vec<u8>>`.
11
+
- Rust guests are encouraged to use the new `hyperlight_guest_bin::guest_dispatch!` macro instead of defining the symbol by hand.
12
+
-`GuestFunctionDefinition::new` now takes a typed function pointer instead of `usize`, so callers passing `func as usize` will get a compile error.
0 commit comments