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

mechanic to define vmethod interposes via Lua #4882

Open
ab9rf opened this issue Aug 29, 2024 · 1 comment
Open

mechanic to define vmethod interposes via Lua #4882

ab9rf opened this issue Aug 29, 2024 · 1 comment

Comments

@ab9rf
Copy link
Member

ab9rf commented Aug 29, 2024

basically implement some mechanic such that a vmethod interpose can be implemented in Lua instead of C++

this would facilitate modders doing things that can be done by vmethod interpose without having to dive deep into C++ to do it, which would benefit development velocity of new ideas. obviously this shouldn't be used for high-frequency vmethods due to performance concerns, but if someone comes up with a good idea with a Lua interpose that presents a performance concern, we can always reimplement in native code

@ab9rf
Copy link
Member Author

ab9rf commented Aug 30, 2024

so the conclusion i've come to while poking around this issue is, because we can only store a pointer to executable code in a vtable, implementing this will require the ability to create new code at runtime so that a pointer to that code can be inserted into the vtable. this isn't impossible, of course, but it requires special consideration (e.g. mprotect in linux, VirtualProtect in Windows). so this won't be a trivial implementation

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

No branches or pull requests

1 participant