-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add new Mono embedding API to consume binary runtimeconfig format #49740
Conversation
Tagging subscribers to this area: @CoffeeFlux Issue DetailsFixes #49236
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use the mono-mmap functions to open the file - it can fall back to making a copy of the data, but it doesn't have to.
- Use the
mono_metadata_decode_blob
function to get the lengths. - I don't think you should parse the file right away. Just save away the
MonovmRuntimeConfigArguments
and the cleanup function, and parse right inmono_runtime_install_appctx_properties
when we have both sets of arguments and we can create a single set of arrays to pass to managed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great steps in the right direction.
I'm suspicious about g_new0
not doing the right thing - I suspect it's because you're accessing the monovm_initialize keys and values after that function has already returned. Unfortunately there's no avoiding making a copy of those since the caller of monovm_initiaze
might free them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeps getting better. But let's keep going.
I sketched out how I think _install
should look. monovm_runtimeconfig_initialize
can be literally a 1 liner that just stores arg
, cleanup_fn
and user_data
to mono_runtime_register_runtimeconfig_json_properties
without doing anything to them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM. Thanks @fanyang-mono !
I'll go through one more time in a couple of hours in detail, for any minor nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, went through in detail. Couple of minor whitespace nits, but otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a couple of thoughts about simplifying things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mix of nits and comments about unneeded strlen and strcpy calls. This is called during startup, so we really need to include as few of them as possible. Getting close though! 😄
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
Co-authored-by: Ryan Lucia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit, but otherwise should be good to go!.
Co-authored-by: Ryan Lucia <[email protected]>
Fixes #49236