Simplify Memory::memnew_arr_placement to always initialize memory, to force callers to make the decision of whether to initialize.

This commit is contained in:
Lukas Tenbrink
2025-05-19 20:52:08 +02:00
parent 7a0ab9d561
commit 4371aa864d
5 changed files with 16 additions and 16 deletions

View File

@ -93,13 +93,13 @@ public:
_FORCE_INLINE_ operator Span<T>() const { return _cowdata.span(); }
_FORCE_INLINE_ Span<T> span() const { return _cowdata.span(); }
_FORCE_INLINE_ void clear() { resize(0); }
_FORCE_INLINE_ void clear() { _cowdata.clear(); }
_FORCE_INLINE_ bool is_empty() const { return _cowdata.is_empty(); }
_FORCE_INLINE_ T get(Size p_index) { return _cowdata.get(p_index); }
_FORCE_INLINE_ const T &get(Size p_index) const { return _cowdata.get(p_index); }
_FORCE_INLINE_ void set(Size p_index, const T &p_elem) { _cowdata.set(p_index, p_elem); }
Error resize(Size p_size) { return _cowdata.resize(p_size); }
Error resize(Size p_size) { return _cowdata.template resize<!std::is_trivially_constructible_v<T>>(p_size); }
Error resize_zeroed(Size p_size) { return _cowdata.template resize<true>(p_size); }
_FORCE_INLINE_ const T &operator[](Size p_index) const { return _cowdata.get(p_index); }
// Must take a copy instead of a reference (see GH-31736).