Skip to content

Conversation

@karlseguin
Copy link
Collaborator

TypeMeta constains the index and the subtype. This allows retrieving the subtype based on the actual value being bound, as opposed to the struct type. (I.e. it returns the correct subtype when a Zig class is a proxy for another using the Self declaration).

Internally store the subtype as an enum. Reduces @sizeof(TaggedAnyOpaque) from 32 to 16.

Finally, sub_type renamed to subtype for consistency with v8.

TypeMeta constains the index and the subtype. This allows retrieving the subtype
based on the actual value being bound, as opposed to the struct type. (I.e. it
returns the correct subtype when a Zig class is a proxy for another using the
Self declaration).

Internally store the subtype as an enum. Reduces @sizeof(TaggedAnyOpaque) from
32 to 16.

Finally, sub_type renamed to subtype for consistency with v8.
Copy link
Contributor

@sjorsdonkers sjorsdonkers left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,20 @@
pub const SubType = enum {
Copy link
Contributor

Choose a reason for hiding this comment

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

Subtype? :P

@sjorsdonkers sjorsdonkers mentioned this pull request Apr 18, 2025
@krichprollsch krichprollsch merged commit 646fcaf into main Apr 18, 2025
12 checks passed
@krichprollsch krichprollsch deleted the subtype_fix branch April 18, 2025 07:47
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 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.

4 participants