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

Experiment: Add buffer type and inline pointer #14036

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

@Jarred-Sumner Jarred-Sumner marked this pull request as ready for review September 20, 2024 04:26
@Jarred-Sumner Jarred-Sumner merged commit f263436 into main Sep 20, 2024
41 of 44 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/inline-arraybufferview branch September 20, 2024 04:26
@@ -2064,7 +2080,7 @@ pub const FFI = struct {
function = 17,
napi_env = 18,
napi_value = 19,

buffer = 20,
pub const max = @intFromEnum(ABIType.napi_value);
Copy link
Contributor

@190n 190n Sep 20, 2024

Choose a reason for hiding this comment

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

should at least change to ABIType.buffer, or we can calculate the max:

Suggested change
pub const max = @intFromEnum(ABIType.napi_value);
pub const max = max_abi_type: {
var current_max = std.math.minInt(i32);
for (@typeInfo(ABIType).Enum.fields) |f| {
current_max = @max(current_max, f.value);
}
break :max_abi_type current_max;
};

or, could we @cImport these?

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.

3 participants