summaryrefslogtreecommitdiffstats
path: root/core/os/memory.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add debug utilities for VulkanMatias N. Goldberg2024-08-211-0/+33
| | | | | | | | | | | | | | | | | | | | | Features: - Debug-only tracking of objects by type. See get_driver_allocs_by_object_type et al. - Debug-only Breadcrumb info for debugging GPU crashes and device lost - Performance report per frame from get_perf_report - Some VMA calls had to be modified in order to insert the necessary memory callbacks Functionality marked as "debug-only" is only available in debug or dev builds. Misc fixes: - Early break optimization in RenderingDevice::uniform_set_create ============================ The work was performed by collaboration of TheForge and Google. I am merely splitting it up into smaller PRs and cleaning it up.
* [Core] Improve `CowData` and `Memory` metadata alignment.bruvzg2024-02-051-12/+12
|
* [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-111-3/+3
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-1/+0
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Modernize atomicsPedro J. Estébanez2021-02-181-13/+13
| | | | | | | | | | - Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-2/+2
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-11/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-2/+0
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Replace NULL with nullptrlupoDharkael2020-04-021-6/+6
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Remove all uses of ERR_EXPLAIN macros.Marcel Admiraal2019-11-111-6/+3
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix unused variable and wrong warning workaroundRémi Verschelde2018-10-041-10/+1
| | | | | | | | | I had been looking at the wrong line all along when attempting to fix: ``` core/os/memory.cpp:184:13: warning: unused variable 's' [-Wunused-variable] uint64_t *s = (uint64_t *)mem; ^ ```
* Fix GCC 8 warnings about potentially unitialized variablesRémi Verschelde2018-10-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 8 warnings: ``` core/image.cpp:730:44: warning: 'mip1_weight' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip2' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip1' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:58:19: warning: 'vmax' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:85:19: warning: 'vmin' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/editor_themes.cpp:306:53: warning: 'preset_contrast' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:459:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:443:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] main/tests/test_oa_hash_map.cpp:57:29: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg.cpp:764:40: warning: 'max_angle' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg_shape.cpp:1945:3: warning: 'face_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1593:8: warning: 'cone_aperture' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1592:6: warning: 'cone_dir_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/animation/animation_blend_space_2d.cpp:471:8: warning: 'mind' may be used uninitialized in this function [-Wmaybe-uninitialized] core/os/memory.cpp:94: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:95: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:98: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ```
* Fix some OSX and iOS Clang warningsRémi Verschelde2018-10-041-0/+5
| | | | | | | | | | | | | | | Fixes the following XCode 9.4.1 warnings: ``` core/os/memory.cpp:175:13: warning: unused variable 's' [-Wunused-variable] drivers/coremidi/core_midi.cpp:68:14: warning: comparison between NULL and non-pointer ('MIDIEndpointRef' (aka 'unsigned int') and NULL) [-Wnull-arithmetic] drivers/gles2/rasterizer_gles2.cpp:77:24: warning: unused function '_gl_debug_print' [-Wunused-function,34] drivers/unix/thread_posix.cpp:106:12: warning: unused variable 'running_thread' [-Wunused-variable,34] modules/gdnative/nativescript/nativescript.h:371:16: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] platform/iphone/gl_view.mm:56:14: warning: unused variable 'video_previous_volume' [-Wunused-variable,34] platform/iphone/gl_view.mm:251:12: warning: unused function 'get_first_id' [-Wunused-function,34] platform/iphone/main.m:45:15: warning: unused variable 'app' [-Wunused-variable,34] platform/osx/os_osx.mm:79:15: warning: unused function 'convertRectToBacking' [-Wunused-function] ```
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-2/+4
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Add placement deletes to avoid warnings on VC++Matthias Hoelzl2017-11-191-0/+20
| | | | | | | | | | | | | | | | | | | When compiling with VC++ 2017, Godot generates huge numbers of C4291 warnings about missing placement delete. I have not found a way to disable these warnings using compiler options: AFAICT there is no equivalent to `-f-no-exceptions` for VC++ (there is only /EH to change the exception-handling model, /GX is deprecated) and adding /wd4291 to the `disable_nonessential_warnings` list in the `SConstruct` file or even compiling with `warnings=no` does not disable the messages. Placement delete is only called when placement new throws an exception, since Godot doesn't use exceptions this change should have no runtime effect. Fixes #12654 (probably, difficult to say without log)
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Use atomics for memory use trackingPedro J. Estébanez2017-08-011-19/+21
| | | | | | | | Plus: - An allocation is counted only after checking its success. - Max usage is updated after growing reallocs as well. - Drop unused header. - Changed the 0xFFF.. at get_mem_available() to -1 with a comment telling it's the same, but more universal.
* Revert "Improve reliability of memory stats"Rémi Verschelde2017-07-111-50/+49
|
* Implement byte-tagging of memoryPedro J. Estébanez2017-07-051-2/+26
| | | | | | Using a magic value for memory allocated but uninitialized and another one for memory about-to-be-released. Helps in debugging unitialized members, dangling pointerts, etc. Disabled by default. Can be enabled for debug builds by defining `DEBUG_MEMORY_TAGGING`.
* Improve reliability of memory statsPedro J. Estébanez2017-07-051-49/+26
| | | | | | | | The allocation count is managed atomically and where it actually should change (for instance, not counting an allocation before its success has been checked). Bonus: Improve readability of the pre-pad checks.
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-61/+51
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky2017-01-071-83/+0
| | | | renamed to PoolVector
* -Changed memory functions, Memory::alloc_static*, simplified them, made them ↵Juan Linietsky2017-01-061-24/+181
| | | | | | aligned to 16 -Changed Vector<> template to fit this.
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* remove trailing whitespaceHubert Jarosz2016-03-091-3/+3
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* some optimizations in godot memory handlingJuan Linietsky2015-06-121-7/+0
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+134