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

Setup enum-struct address #2213

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Setup enum-struct address #2213

wants to merge 1 commit into from

Conversation

Kenzzer
Copy link
Member

@Kenzzer Kenzzer commented Oct 29, 2024

This PR attempts to transform Address into an enum struct, but ultimately I believe the PR serves as a good showcase as to why we shouldn't...

Primary goal

Avoid deprecation of 5-10 natives, whilst also keeping memory manipulation in plugin 'simple'.

Backward Compatibility

We're still runtime backward compatible. However we're not source backward compatible, operations like view_as<int> or ++ will no longer work as they do not exist for enum structs. This is going to break compilation (to the best of our knowledge) of at least 200 plugins.

What about PR #2196 ?

This is ultimately down to preferences. But after working on this, I believe it would be better to turn Address into an handle type, and overload the math operators. This might create problems regarding freeing Address, as plugin authors will get confused looking at older plugin source and not see in use the delete operator. But that outcome is still better, than wrecking havok on in the C++ api with an enum struct type that cannot be passed around extensions as easily as if it was an handle type. Something I could not forsee prior working on this.

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