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

Add PackedArrayRef classes, instances of PackedArrayRefRAII. #98373

Closed
wants to merge 1 commit into from

Conversation

Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Oct 21, 2024

Closes godotengine/godot-proposals#10830.

The use-case of these new objects are explained in the proposal, but in short: They allow strongly typed in-place modification of Packed arrays. In-place modification without this PR is only possible through Variant's stringy interfaces.

This PR compiles, but I have not yet tested the behavior. In particular:

  • PackedArrayRefRAII classes should be especially useful in GDExtensions, and thus should be exposed to them. I have not not done this before yet so I'll have to take another look at that.

@Ivorforce Ivorforce requested review from a team as code owners October 21, 2024 00:11
@Ivorforce Ivorforce force-pushed the packed-array-ref branch 2 times, most recently from 19edb4d to a8774cb Compare October 21, 2024 00:20
@Ivorforce
Copy link
Member Author

I used the current naming pattern for the new reference objects, but a case could be made to name them with the c++ pattern (SharedPackedXArray). I would prefer that since it makes for clearer semantics.

@fire
Copy link
Member

fire commented Oct 21, 2024

Are you aware that the github actions cicd tests are failing?

@Ivorforce
Copy link
Member Author

Are you aware that the github actions cicd tests are failing?

Right, should be all fixed now :)

…mic Variant's PackedArray behavior as a ref counted shared ownership of a single instance PackedArray.
@Ivorforce
Copy link
Member Author

With #99201 merged, i now longer have a personal use-case for this PR. Therefore, i will close it. If another use case for exposing PackedArrayRef emerges, please open up a new PR based on this one.

@Ivorforce Ivorforce closed this Nov 27, 2024
@AThousandShips AThousandShips removed this from the 4.x milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose PackedArrayRef outside Variant in Core, GDExtension (+godot-cpp)
4 participants