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

Remove references to PoolVector #10329

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

esainane
Copy link
Contributor

@esainane esainane commented Nov 28, 2024

PoolVector has not existed since 2020. It was removed in godotengine/godot@3205a92a.

Bugsquad edit: closes #10146, possibly also #3192 and #6259

PoolVector has not existed since 2020.

It was removed in 3205a92a:
godotengine/godot@3205a92a
@tetrapod00 tetrapod00 added bug area:manual Issues and PRs related to the Manual/Tutorials section of the documentation area:contributing Issues and PRs related to the Contributing/Development section of the documentation cherrypick:4.3 labels Nov 29, 2024
Copy link
Contributor

@tetrapod00 tetrapod00 left a comment

Choose a reason for hiding this comment

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

Looks right to me but needs a second review from someone more familiar with the C++ codebase (are there any caveats to Vector<> that must be mentioned?)
The return types from map_get_path are now correct.

locked until they go out of scope. However, PoolVectors should be used
for small, dynamic memory operations, as read() and write() are too slow for a
large amount of accesses.
For dynamic memory, use Vector<>.
Copy link
Member

Choose a reason for hiding this comment

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

This page should also mention LocalVector, and Packed*Vector.

  • Vector<> - copy-on-write and can be safely passed via public API.
  • Packed*Vector - aliases for specific Vector<*> types accessible via GDScript.
  • LocalVector<> - non COW version, with less overhead, for the internal use.

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep in mind that this PR is fixing a years-old documentation bug. The page should mention these, but is mentioning these a hard enough requirement that it should block merging the bugfix PR? That is, is it acceptable for the page to say only "For dynamic memory, use Vector<>" while a separate PR is worked on, that documents the alternatives?

Copy link
Member

@bruvzg bruvzg Nov 29, 2024

Choose a reason for hiding this comment

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

Yes, it is acceptable as a bug fix. For dynamic memory, use Vector<> is correct, and in general a safe option to use, so it's OK as is.

LocalVector<> is a more advanced option with more limitations, and can be added in a different PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's OK as a bugfix, then let's merge this one as-is.

@esainane, you're welcome to document the other options mentioned here if you want to, as another PR, after this one is merged. If you don't feel knowledgeable enough, that is also OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I should be able to do something proper this Sunday.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I have a suitable follow up ready to go, in case people were waiting?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine to bundle it into this PR, since it's not actually merged yet.

(I thought we might have merged this already, but without an explicit second approval from an experienced engine dev I ended up not merging it yet)

@tetrapod00 tetrapod00 merged commit 5589314 into godotengine:master Dec 5, 2024
1 check passed
@tetrapod00
Copy link
Contributor

Thank you!

I decided to merge this as a bugfix as-is. If you have a followup PR ready to document the other options, it would be very welcome 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug cherrypick:4.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs use old and removed PoolVector
3 participants