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

Simplify call and construct to only take a AsRef<Handle<JsValue>> that can be directly passed to args #825

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

kjvalencik
Copy link
Member

@kjvalencik kjvalencik commented Nov 12, 2021

A future PR will add a high level builder API for calling functions. In order to maintain a low level, high performance API, the existing APIs have been adapted to not require unnecessary allocation.

I went with AsRef<[u8]> so that Vec could be passed directly since this is an existing common pattern. The downside is that it could result in code bloat from monomorphization if many sized arrays are passed. We could minimize this later by moving the body of the function externally--this is a common pattern in std.

…>` that can be directly passed to args

A future PR will add a high level builder API for calling functions. In order to maintain a low level, high performance API, the existing APIs have been adapted to not require unnecessary allocation.
Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kjvalencik kjvalencik merged commit 4581958 into next/0.10 Nov 17, 2021
@kjvalencik kjvalencik deleted the kv/simplify-call-construct branch November 17, 2021 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants