-
Notifications
You must be signed in to change notification settings - Fork 1.6k
c-api: Module definitions in component model linker #10651
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
c-api: Module definitions in component model linker #10651
Conversation
|
Ok I want to definitely apologize -- what I'm thinking now is "let's go back to what you had before". While I agree with my sentiment in #10598 (comment) it's not a hard-and-fast rule we adhere to in the C API. There are a number of other locations where return values are effectively borrowed from the input value. In that sense it's not like we have to 100% avoid it, it's just best if we can IMO. Currently the Ok though so on this PR specifically, my thoughts are:
That all leads me to thinking we should go back to the original API you had sketched out, where the C API is a wrapper around WDYT though about going back to using |
14a3ce7 to
2009437
Compare
|
No problem! Let me know if you think of better names, or see any other issues. I'll do docs and tests tomorrow. |
alexcrichton
left a comment
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.
Nice yeah this looks great, thanks again and sorry for the whiplash!
With tests + docs looks good to me 👍
|
Let me know if you can think of a better way to convey the lifetime rules. What's next, values? |
|
Before values, perhaps instantiation? Then maybe loading exports like functions, and then after that function invocations which would be a forcing function on values? |
|
@alexcrichton WDYM by instantiation? Something other than |
|
Oh ignore me, I forgot that was already added! |
See previous comment #10598 (comment).
Sketched out a similar approach to the one in #9812. I haven't finished it, as I'm quite unsure if this is the way to go.
Would something like this be better?:
That would require adding function to
LinkerInstance, similar tointo_instance(), but instead of inserting to the map, it would fetch.Is that a valid/better approach?
Also, is seperating the path parts by
.fine, or should the path be passed asconst char**?Also also, @alexcrichton, could you provide me a nested test component, as I couldn't for the life of me get the syntax correct? Thanks