Skip to content

Commit

Permalink
Merge pull request #10329 from esainane/pool-closed
Browse files Browse the repository at this point in the history
Remove references to PoolVector
  • Loading branch information
tetrapod00 authored Dec 5, 2024
2 parents 160b937 + 3f206fd commit 5589314
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 27 deletions.
26 changes: 1 addition & 25 deletions contributing/development/core_and_modules/core_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,36 +103,12 @@ which are equivalent to new, delete, new[] and delete[].
memnew/memdelete also use a little C++ magic and notify Objects right
after they are created, and right before they are deleted.

For dynamic memory, the PoolVector<> template is provided. PoolVector is a
standard vector class, and is very similar to vector in the C++ standard library.
To create a PoolVector buffer, use this:

.. code-block:: cpp
PoolVector<int> data;
PoolVector can be accessed using the [] operator and a few helpers exist for this:

.. code-block:: cpp
PoolVector<int>::Read r = data.read()
int someint = r[4]
.. code-block:: cpp
PoolVector<int>::Write w = data.write()
w[4] = 22;
These operations allow fast read/write from PoolVectors and keep it
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<>.

References:
~~~~~~~~~~~

- `core/os/memory.h <https://github.com/godotengine/godot/blob/master/core/os/memory.h>`__
- `core/pool_vector.h <https://github.com/godotengine/godot/blob/master/core/pool_vector.cpp>`__

Containers
----------
Expand Down
4 changes: 2 additions & 2 deletions tutorials/navigation/navigation_using_navigationlayers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In scripts the following helper functions can be used to work with the ``navigat
var path_query_navigation_layers: int = 0
path_query_navigation_layers = enable_bitmask_inx(path_query_navigation_layers, 2)
# get a path that only considers 2-nd layer regions
var path: PoolVector2Array = NavigationServer2D.map_get_path(
var path: PackedVector2Array = NavigationServer2D.map_get_path(
map,
start_position,
target_position,
Expand Down Expand Up @@ -120,7 +120,7 @@ In scripts the following helper functions can be used to work with the ``navigat
var path_query_navigation_layers: int = 0
path_query_navigation_layers = enable_bitmask_inx(path_query_navigation_layers, 2)
# get a path that only considers 2-nd layer regions
var path: PoolVector3Array = NavigationServer3D.map_get_path(
var path: PackedVector3Array = NavigationServer3D.map_get_path(
map,
start_position,
target_position,
Expand Down

0 comments on commit 5589314

Please sign in to comment.