Skip to content
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

UnsafeFunctionPointer::Args as a convienence. #479

Open
JCBurnside opened this issue Feb 26, 2024 · 2 comments
Open

UnsafeFunctionPointer::Args as a convienence. #479

JCBurnside opened this issue Feb 26, 2024 · 2 comments

Comments

@JCBurnside
Copy link

JCBurnside commented Feb 26, 2024

Is your feature request related to a problem? Please describe.
I am trying to add additional wrapping around engine.get_function to make a jit runtime that would be reusable.

fn get_function<F:UnsafeFunctionPointer>(&self, name:&str, args:...) {
    let function = //gets function
    function.call(args)
}

Describe the solution you'd like
Just simply add an associated type that is a tuple of all the args in the UnsafeFunctionPointer

Describe possible drawbacks to your solution
I don't see one?

Describe alternatives you've considered
essentially cloning the UnsafeFunctionPointer type and adding it myself and making a blanket implementation to map it.

Additional context

@JCBurnside
Copy link
Author

Just realized that your call function is also inconsistent with the nightly fn_traits feature see here so not sure what I want is possible with the current api unless an alternate means of calling it as like call_tuple added to JitFunction as well.

@TheDan64
Copy link
Owner

TheDan64 commented Apr 1, 2024

I'm not entirely sure if this makes sense to have in inkwell itself, but I'm open to ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants