356 Commits

Author SHA1 Message Date
Spartan322
cd86012a9d Merge commit godotengine/godot@71a9948157 2025-07-19 14:15:00 -04:00
Mike Precup
25115609ff Fix issue with array comparison reference 2025-07-09 20:22:09 -07:00
Spartan322
63bd691bb9 Merge commit godotengine/godot@88b9932ce1 2025-06-23 16:28:53 -04:00
Lukas Tenbrink
697e0bb077 Use reserve in LocalVector::resize, to restore expected growth behavior. 2025-06-21 11:23:05 +02:00
Spartan322
7f9872092c Merge commit godotengine/godot@5abed52fd9 2025-06-20 03:57:56 -04:00
Thaddeus Crews
ac6252c9c8 Merge pull request #107486 from Ivorforce/rendering-no-alloc-api
Use raw buffer pointers in `RenderingDevice` allocation APIs to avoid intermediary arrays
2025-06-18 18:14:00 -05:00
Lukas Tenbrink
2b36c79f7b Use Span<uint8_t> in RenderingDevice allocation APIs to avoid intermediary arrays on calls. 2025-06-18 12:31:48 +02:00
Haoyu Qiu
296aba7dc5 Fix CSV translation not updating after reimport 2025-06-17 17:22:49 +08:00
Adrien Ufferte
a11a64fbf4 Comments spelling fixes 2025-06-15 01:36:10 +02:00
Lukas Tenbrink
2d0ff9774d Add a smoke test to Span in debug builds to recover from non-empty nullptr Span. 2025-06-12 12:19:21 +02:00
Spartan322
9023767920 Merge commit godotengine/godot@1bbfe637c6 2025-06-10 22:00:50 -04:00
Lukas Tenbrink
d2f9d31270 Make more types (Callable, Signal) conversion to String explicit. 2025-06-10 23:55:35 +02:00
dementive
d2814ebbf3 Add missing Color hash function 2025-06-08 14:49:50 -04:00
Spartan322
0e99b001ac Merge commit godotengine/godot@5dd76968d8 2025-06-05 23:07:30 -04:00
Rémi Verschelde
61639d9574 Merge pull request #106996 from Ivorforce/no-oa-hashmap
Core: Remove `OAHashMap`, in favour of `AHashMap`
2025-06-05 13:12:34 +02:00
aaronp64
6b2674fe18 Reuse and optimize sorting logic for List, SelfList, and HashMap
Added SortList class, and updated List, SelfList, and HashMap sort methods to use it.  Sorting is done with merge sort, with an initial check to optimize for already sorted lists, and sorted lists that were appended to.
2025-06-04 10:18:22 -04:00
Thaddeus Crews
7a3d2f6779 Merge pull request #106606 from aaronfranke/pow2_64
Add 64-bit versions of core power of 2 functions
2025-06-02 18:51:56 -05:00
Aaron Franke
f6f1df7d73 Add 64-bit versions of core power of 2 functions 2025-06-01 23:11:12 -07:00
Lukas Tenbrink
963c20565b Remove OAHashMap, in favour of AHashMap.
The two types had (mostly) the same decisions, but `AHashMap` is a faster implementation, and is more consistent with `HashMap`.
2025-05-31 15:50:10 +02:00
LuoZhihao
21e2bac382 Add missing headers in FixedVector and Span 2025-05-30 13:41:45 +08:00
Spartan322
b666f4fc15 Merge commit godotengine/godot@de37627404 2025-05-29 05:22:55 -04:00
Thaddeus Crews
2cde9292c3 Merge pull request #106876 from Ivorforce/localvector-no-force-trivial
Un-support `force_trivial` parameter for `LocalVector`. Instead, users should use `resize_uninitialized`.
2025-05-28 09:47:45 -05:00
Lukas Tenbrink
37415530d7 Un-support force_trivial parameter for LocalVector. Instead, users are reformatted to use resize_uninitialized to make it explicit that the resize does not initialize missing elements. 2025-05-27 18:43:36 +02:00
Lukas Tenbrink
d2d57849de Add a safety check for CowData::_unref(), for when something tries to add elements during destruction. 2025-05-27 18:00:48 +02:00
Thaddeus Crews
0c12e758ac Merge pull request #106569 from Ivorforce/hashmap-if-mod
Accelerate `HashMap` and `HashSet` lookup by using `if` based modulo in loops
2025-05-27 09:39:29 -05:00
Lukas Tenbrink
670ab7a383 Add resize_initialized and resize_uninitialized to LocalVector. 2025-05-26 18:35:41 +02:00
Lukas Tenbrink
4cb8a0c77e Add resize_initialized and resize_uninitialized to Vector. These functions serve as replacements for resize, to make sure the caller understands whether elements need to be initialized 'by hand' after the call. 2025-05-26 18:35:41 +02:00
Lukas Tenbrink
4371aa864d Simplify Memory::memnew_arr_placement to always initialize memory, to force callers to make the decision of whether to initialize. 2025-05-22 22:25:12 +02:00
Spartan322
38fb5272ad Merge commit godotengine/godot@7a0ab9d561 2025-05-22 14:03:25 -04:00
Thaddeus Crews
15cd5e1619 Merge pull request #106689 from aaronp64/ringbuffer_localvector
Use `LocalVector` for `RingBuffer`
2025-05-22 12:15:03 -05:00
Thaddeus Crews
c3c3657a0d Merge pull request #106661 from KirbyRider1337/dont-compare-the-same-item-with-itself
Prevent comparison of items with themselves while partitioning sort arrays
2025-05-22 12:14:58 -05:00
KirbyRider1337
caf8053b86 Adjusted get_median_from_3 and partitioner to also retrieve the pivot's index and check if either end of the partitioner has reached it to avoid comparing things with themselves 2025-05-21 14:38:09 -04:00
aaronp64
2a02cabe4d Use LocalVector for RingBuffer
Updated RingBuffer to use LocalVector instead of Vector, to avoid _copy_on_write overhead when writing to the buffer.
2025-05-21 13:50:10 -04:00
Lukas Tenbrink
70f8dd29f5 Simplify use of LocalVector force_trivial template parameter. 2025-05-19 20:27:14 +02:00
Thaddeus Crews
2d42b889d1 Merge pull request #104124 from Ivorforce/alloc-static-calloc
Add `Memory::alloc_static_zeroed` to allocate memory that's filled with zeroes.
2025-05-19 08:01:33 -05:00
Lukas Tenbrink
6fe17b264e Use if based mod in HashMap and HashSet in loops (faster than fastmod). 2025-05-18 20:05:34 +02:00
Thaddeus Crews
5538850d87 Core: Convert Pair/KeyValue to constexpr 2025-05-15 10:37:41 -05:00
Spartan322
63f2d58fcf Merge commit godotengine/godot@428a762e98 2025-05-14 14:16:55 -04:00
Yufeng Ying
3bf400ffae Move bisect to Span and deduplicate code.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2025-05-14 18:19:09 +08:00
Yufeng Ying
0babb2ab02 Optimize HashMap size for zero-sized Allocators. 2025-05-13 21:44:39 +08:00
Lukas Tenbrink
3207066e19 Add Memory::alloc_static_zeroed to allocate memory that's filled with zeroes.
This is generally faster than `malloc` followed by `memset` / loop-set to 0.
2025-05-13 01:57:05 +02:00
Rémi Verschelde
4c62c8aceb Merge pull request #106020 from Ivorforce/hashmap-duplicate-hash
Optimize `HashMap` insertion by removing duplicate computation of hash and position
2025-05-13 01:04:57 +02:00
Rémi Verschelde
2b037e8989 Merge pull request #93276 from mashumafi/avoid-vec-copy
Avoid unnecessary copy-on-write Vector/Array
2025-05-13 01:04:16 +02:00
mashumafi
b73346ef19 Avoid copy-on-write when reading vectors 2025-05-12 16:08:05 +02:00
Yufeng Ying
2db0a44519 Remove vmap.h 2025-05-09 19:05:28 +08:00
Spartan322
a30eb5a590 Merge commit godotengine/godot@6a6a1168a5 2025-05-07 10:35:16 -04:00
Lukas Tenbrink
1d49a557b6 Optimize away duplicate hash and position computation in HashMap on insert.
Co-authored-by: Nazarii <nazarii.yablonskyi.pp.2022@lpnu.ua>
2025-05-02 19:02:03 +02:00
Thaddeus Crews
01fc9aee6c Core: Modernize C headers with C++ equivalents 2025-05-02 08:23:01 -05:00
Spartan322
8122592328 Merge commit godotengine/godot@80a3d205f1 2025-05-01 01:30:09 -04:00
Lukas Tenbrink
1b1ab76a14 Add FixedVector template.
This is a high performance `Vector`-like object that can be used if the maximum number of objects is small and known, and the objects are needed only temporarily.
2025-04-30 19:14:08 +02:00