summaryrefslogtreecommitdiff
path: root/core/templates/cowdata.h
AgeCommit message (Collapse)Author
2023-01-05One Copyright Update to rule them allRémi Verschelde
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".
2022-10-03Remove NO_THREADS fallback code, Godot 4 requires thread supportRémi Verschelde
This also removes `OS::can_use_threads` from the public API since it's always true.
2022-08-04Merge pull request #63906 from Faless/fix/4.x_warningsRémi Verschelde
2022-08-04[Core] Use std type traits to check operations triviality.Fabio Alessandrelli
2022-08-04Arrays: Zero new items of trivial types on resize() (bindings only)Rémi Verschelde
This is not enabled by default in the core version for performance reasons, as Vector/CowData are used in critical code paths where not zero'ing memory which is going to be set later on can be important. But for bindings / the scripting API, we make zero the new items by default (which already happened for built types like Vector3, etc., but not for trivial types like int, float). Fixes #43033. Co-authored-by: David Hoppenbrouwers <david@salt-inc.org>
2022-05-07Add search methods for packed arraysHaoyu Qiu
* count() * find() * rfind()
2022-04-09Remove get_data() from CowDataBartłomiej T. Listwon
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-09-15Fix placement new on zero-sized region warning on GCC 11.1Grigoris Pavlakis
On latest (11.1 as of this commit) GCC, the following warning is continuously issued during build: warning: placement new constructing an object of type 'SafeNumeric<unsigned int>' and size '4' in a region of type 'uint32_t*' {aka 'unsigned int*'} and size '0' [-Wplacement-new=] This happens because on 98ceb60eb4 the new operator override used was dropped and replaced with standard placement new. GCC sees the subtraction from the pointer and complains as it thinks that the SafeNumeric is placed outside an allocation, not knowing that the address requested is already inside one. After suggestions, the false positive is silenced, with no other changes.
2021-08-13Refactors the memnew_placement.AndreaCatania
With this commit the macro `memnew_placement` uses the standard memory placement syntax: `new (mem) TheClass()`, and removes the outdated and not used syntax: ``` _ALWAYS_INLINE_ void *operator new(size_t p_size, void *p_pointer, size_t check, const char *p_description) { ``` Thanks to this change, the function `memnew_placement` call is compatible with any class, and can also initialize classes with non-empty constructor: ``` // This is valid, like before. memnew_placement(mem, Variant); // This works too: memnew_placement(mem, Variant(123)); ```
2021-02-24Change CRASH_COND to ERR_FAIL in Cowdata::setRafał Mikrut
2021-02-19Improve robustness of atomicsPedro J. Estébanez
And fix increment in `CowData` not being conditional anymore after the recent changes. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18Modernize atomicsPedro J. Estébanez
- 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>
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code