Skip to content

Conversation

@karlseguin
Copy link
Collaborator

Some APIs need a null-terminated string. Currently, they have to ask for a []const u8 and then convert it to a [:0]const u8. This is 2 allocations: 1 for jsruntime to get the []const u8 from v8, and then one to get the [:0]. By supporting [:0]const u8 directly, this is now a single allocation.

Some APIs need a null-terminated string. Currently, they have to ask for a
`[]const u8` and then convert it to a `[:0]const u8`. This is 2 allocations: 1
for jsruntime to get the `[]const u8` from v8, and then one to get the [:0]. By
supporting `[:0]const u8` directly, this is now a single allocation.
@krichprollsch krichprollsch merged commit 4b7c17a into main Apr 22, 2025
12 checks passed
@krichprollsch krichprollsch deleted the jsruntime_js_to_null_terminated_string branch April 22, 2025 07:11
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants