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

feat(rotable): add metatable support to rotable #54

Merged
merged 2 commits into from
Jul 22, 2024
Merged

Conversation

XuNeo
Copy link
Owner

@XuNeo XuNeo commented Jul 21, 2024

Since rodata's meta table is already used to fake the normal table operation, we use userdata uservalue[2] to store an optional table as meta table. It's further searched when no match found in rodata's __index method.

Fix bug in rotable_newidx.

@XuNeo
Copy link
Owner Author

XuNeo commented Jul 21, 2024

Requires lua5.4

So we can use the userdata uservalue for other purpose

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo force-pushed the rotable-metatable branch 2 times, most recently from 48c08f0 to 6b74d21 Compare July 22, 2024 15:57
Use userdata's uservalue as a place to store metatable.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
@XuNeo XuNeo merged commit b0ab87c into master Jul 22, 2024
1 check passed
@XuNeo XuNeo deleted the rotable-metatable branch July 22, 2024 16:29
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.

1 participant