File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
engine_details/architecture Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,21 @@ scripting API.
150150.. |typed_dictionary | replace :: `TypedDictionary <https://github.com/godotengine/godot/blob/master/core/variant/typed_dictionary.h >`__
151151.. |pair | replace :: `Pair <https://github.com/godotengine/godot/blob/master/core/templates/pair.h >`__
152152
153+ Relocation safety
154+ ^^^^^^^^^^^^^^^^^
155+
156+ Godot's containers assume their elements are `trivially relocatable <https://open-std.org/JTC1/SC22/WG21/docs/papers/2020/p1144r5.html >`__.
157+
158+ This means that, if you store data types in it that have pointers to themselves, or are otherwise
159+ `not trivially relocatable <https://open-std.org/JTC1/SC22/WG21/docs/papers/2020/p1144r5.html#non-trivial-samples >`__,
160+ Godot might crash. Note that storing **pointers to ** objects that are not trivially relocatable, such as some Object
161+ subclasses, is unproblematic and supported.
162+
163+ The reason to assume trivial relocatability is that it allows us to make use of important optimization techniques, such
164+ as relocation by ``memcpy `` or ``realloc ``.
165+
166+ `GH-100509 <https://github.com/godotengine/godot/issues/100509 >`__ tracks this decision.
167+
153168.. _doc_core_concurrency_types :
154169
155170Multithreading / Concurrency
You can’t perform that action at this time.
0 commit comments