-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Refresh core_types.rst to remove outdated and redundant information. #11439
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
base: master
Are you sure you want to change the base?
Conversation
I've seen a few examples out there but I agree it's very uncommon now, so it's safe to remove. |
| ``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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``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. |
| 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``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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`. |
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
uint32_t.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.size_tis always 64 bit is plain wrong, it's 32-bit in 32-bit binaries.CharTypeno longer exists,wchar_tis 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 —
Objecttypes 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