Skip to content

Conversation

@Ivorforce
Copy link
Member

@Ivorforce Ivorforce commented Nov 4, 2025

The page currently contains quite a lot of outdated, redundant, or unnecessary information.

In the interest of streamlining what is needed, I'm proposing to remove these parts:

Definitions

  • The use of C99 types is now so standard that it is not necessary to mention it. I've never seen a codebase that "reinvents the wheel" and provides its own aliases. Anyone even remotely used to C or C++ will recognize uint32_t.
  • The page makes recommendations about whether to use platform dependent (e.g. int) or platform independent (e.g. uint32_t) types. Our stance towards this has changed, and we now prefer platform independent types. Anyway, recommendations are better saved for the contributing docs, so this should be removed.
  • The claim that size_t is always 64 bit is plain wrong, it's 32-bit in 32-bit binaries.
  • CharType no longer exists, wchar_t is used.

Memory Model
While a nice read, I don't think this text is needed. There are no practical take-aways from this section. Some of the claims are now wrong or misleading. For example, Godot's types are not always minimal — Object types are unexpectedly large, and they are some of Godot's most common types.
The part about allocation and segmentation details has unbacked claims. Since the text was written (earlier than 2015), allocators and memory management have changed. Besides, I've seen reports of modern C++ projects that changed significantly in RAM use when using different allocators, due to fragmentation. It is not relevant to document this, and new users of the engine do not need to read this.
The final part with memory pools is no longer relevant (or at least, no longer nearly as relevant). Since 4.0, memory pool containers have been removed. Only some memory pools are now used in the engine, most private to specific classes.

Allocating memory

  • Tidied up the examples
  • Removed the recommendations texts. While they are somewhat new, the texts have been superseded by the below table, which contains more and more relevant information.
  • The threading safety part has been transferred to its own little section.

@Ivorforce Ivorforce added enhancement area:engine details Issues and PRs related to the Engine Details section of the documentation labels Nov 4, 2025
@Ivorforce Ivorforce requested a review from a team November 4, 2025 15:02
@Calinou
Copy link
Member

Calinou commented Nov 4, 2025

The use of C99 types is now so standard that it is not necessary to mention it. I've never seen a codebase that "reinvents the wheel" and provides its own aliases.

I've seen a few examples out there but I agree it's very uncommon now, so it's safe to remove.

Comment on lines +44 to +46
``memnew``/``memdelete`` also use a little C++ magic to automatically call post-init
and pre-release functions, for example to notify Objects right after they are created,
and right before they are deleted.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
``memnew``/``memdelete`` also use a little C++ magic to automatically call post-init
and pre-release functions, for example to notify Objects right after they are created,
and right before they are deleted.
``memnew``/``memdelete`` also use a little C++ magic to automatically call post-init
and pre-release functions. For example, this is used to notify Objects right after they are created,
and right before they are deleted.

Comment on lines +156 to +157
None of Godot's containers are thread-safe. When you expect multiple threads to access them, you must use multithread
protections, like ``Mutex`` or ``Semaphore``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
None of Godot's containers are thread-safe. When you expect multiple threads to access them, you must use multithread
protections, like ``Mutex`` or ``Semaphore``.
None of Godot's containers are thread-safe. When you expect multiple threads to access them, you must use multithread
protections, like :ref:`class_mutex` or :ref:`class_semaphore`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:engine details Issues and PRs related to the Engine Details section of the documentation cherrypick:4.4 cherrypick:4.5 enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants