Skip to content

Commit

Permalink
_uninitialized instead of _for_override
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Jul 15, 2024
1 parent 8d163ef commit 4bdd2b5
Show file tree
Hide file tree
Showing 30 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion extension/json/json_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct JSONKeyReadResult {
static inline JSONKeyReadResult ReadString(const char *ptr, const char *const end, const bool escaped) {
const char *const before = ptr;
if (escaped) {
auto key = make_unsafe_uniq_array_for_override<char>(end - ptr);
auto key = make_unsafe_uniq_array_uninitialized<char>(end - ptr);
idx_t key_len = 0;

bool backslash = false;
Expand Down
4 changes: 2 additions & 2 deletions src/common/row_operations/row_gather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ static void GatherNestedVector(Vector &rows, const SelectionVector &row_sel, Vec
auto ptrs = FlatVector::GetData<data_ptr_t>(rows);

// Build the gather locations
auto data_locations = make_unsafe_uniq_array_for_override<data_ptr_t>(count);
auto mask_locations = make_unsafe_uniq_array_for_override<data_ptr_t>(count);
auto data_locations = make_unsafe_uniq_array_uninitialized<data_ptr_t>(count);
auto mask_locations = make_unsafe_uniq_array_uninitialized<data_ptr_t>(count);
for (idx_t i = 0; i < count; i++) {
auto row_idx = row_sel.get_index(i);
auto row = ptrs[row_idx];
Expand Down
2 changes: 1 addition & 1 deletion src/common/serializer/binary_deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ string BinaryDeserializer::ReadString() {
if (len == 0) {
return string();
}
auto buffer = make_unsafe_uniq_array_for_override<data_t>(len);
auto buffer = make_unsafe_uniq_array_uninitialized<data_t>(len);
ReadData(buffer.get(), len);
return string(const_char_ptr_cast(buffer.get()), len);
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/serializer/buffered_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ namespace duckdb {

BufferedFileReader::BufferedFileReader(FileSystem &fs, const char *path, FileLockType lock_type,
optional_ptr<FileOpener> opener)
: fs(fs), data(make_unsafe_uniq_array_for_override<data_t>(FILE_BUFFER_SIZE)), offset(0), read_data(0),
: fs(fs), data(make_unsafe_uniq_array_uninitialized<data_t>(FILE_BUFFER_SIZE)), offset(0), read_data(0),
total_read(0) {
handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ | lock_type, opener.get());
file_size = NumericCast<idx_t>(fs.GetFileSize(*handle));
}

BufferedFileReader::BufferedFileReader(FileSystem &fs, unique_ptr<FileHandle> handle_p)
: fs(fs), data(make_unsafe_uniq_array_for_override<data_t>(FILE_BUFFER_SIZE)), offset(0), read_data(0),
: fs(fs), data(make_unsafe_uniq_array_uninitialized<data_t>(FILE_BUFFER_SIZE)), offset(0), read_data(0),
handle(std::move(handle_p)), total_read(0) {
file_size = NumericCast<idx_t>(fs.GetFileSize(*handle));
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/serializer/buffered_file_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace duckdb {
constexpr FileOpenFlags BufferedFileWriter::DEFAULT_OPEN_FLAGS;

BufferedFileWriter::BufferedFileWriter(FileSystem &fs, const string &path_p, FileOpenFlags open_flags)
: fs(fs), path(path_p), data(make_unsafe_uniq_array_for_override<data_t>(FILE_BUFFER_SIZE)), offset(0),
: fs(fs), path(path_p), data(make_unsafe_uniq_array_uninitialized<data_t>(FILE_BUFFER_SIZE)), offset(0),
total_written(0) {
handle = fs.OpenFile(path, open_flags | FileLockType::WRITE_LOCK);
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/sort/radix_sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void SortTiedBlobs(BufferManager &buffer_manager, const data_ptr_t datapt
return;
}
// Fill pointer array for sorting
auto ptr_block = make_unsafe_uniq_array_for_override<data_ptr_t>(end - start);
auto ptr_block = make_unsafe_uniq_array_uninitialized<data_ptr_t>(end - start);
auto entry_ptrs = (data_ptr_t *)ptr_block.get();
for (idx_t i = start; i < end; i++) {
entry_ptrs[i - start] = row_ptr;
Expand Down Expand Up @@ -158,7 +158,7 @@ inline void InsertionSort(const data_ptr_t orig_ptr, const data_ptr_t temp_ptr,
const data_ptr_t target_ptr = swap ? orig_ptr : temp_ptr;
if (count > 1) {
const idx_t total_offset = col_offset + offset;
auto temp_val = make_unsafe_uniq_array_for_override<data_t>(row_width);
auto temp_val = make_unsafe_uniq_array_uninitialized<data_t>(row_width);
const data_ptr_t val = temp_val.get();
const auto comp_width = total_comp_width - offset;
for (idx_t i = 1; i < count; i++) {
Expand Down Expand Up @@ -258,7 +258,7 @@ void RadixSort(BufferManager &buffer_manager, const data_ptr_t &dataptr, const i
auto temp_block =
buffer_manager.Allocate(MemoryTag::ORDER_BY, MaxValue(count * sort_layout.entry_size, block_size));
auto pre_allocated_array =
make_unsafe_uniq_array_for_override<idx_t>(sorting_size * SortConstants::MSD_RADIX_LOCATIONS);
make_unsafe_uniq_array_uninitialized<idx_t>(sorting_size * SortConstants::MSD_RADIX_LOCATIONS);
RadixSortMSD(dataptr, temp_block.Ptr(), count, col_offset, sort_layout.entry_size, sorting_size, 0,
pre_allocated_array.get(), false);
}
Expand Down Expand Up @@ -313,7 +313,7 @@ void LocalSortState::SortInMemory() {
if (!ties) {
// This is the first sort
RadixSort(*buffer_manager, dataptr, count, col_offset, sorting_size, *sort_layout, contains_string);
ties_ptr = make_unsafe_uniq_array_for_override<bool>(count);
ties_ptr = make_unsafe_uniq_array_uninitialized<bool>(count);
ties = ties_ptr.get();
std::fill_n(ties, count - 1, true);
ties[count - 1] = false;
Expand Down
8 changes: 4 additions & 4 deletions src/common/types/bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void Bit::ToString(string_t bits, char *output) {

string Bit::ToString(string_t str) {
auto len = BitLength(str);
auto buffer = make_unsafe_uniq_array_for_override<char>(len);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(len);
ToString(str, buffer.get());
return string(buffer.get(), len);
}
Expand Down Expand Up @@ -150,7 +150,7 @@ void Bit::ToBit(string_t str, string_t &output_str) {

string Bit::ToBit(string_t str) {
auto bit_len = GetBitSize(str);
auto buffer = make_unsafe_uniq_array_for_override<char>(bit_len);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(bit_len);
string_t output_str(buffer.get(), UnsafeNumericCast<uint32_t>(bit_len));
Bit::ToBit(str, output_str);
return output_str.GetString();
Expand All @@ -166,7 +166,7 @@ void Bit::BlobToBit(string_t blob, string_t &output_str) {
}

string Bit::BlobToBit(string_t blob) {
auto buffer = make_unsafe_uniq_array_for_override<char>(blob.GetSize() + 1);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(blob.GetSize() + 1);
string_t output_str(buffer.get(), UnsafeNumericCast<uint32_t>(blob.GetSize() + 1));
Bit::BlobToBit(blob, output_str);
return output_str.GetString();
Expand All @@ -192,7 +192,7 @@ void Bit::BitToBlob(string_t bit, string_t &output_blob) {
string Bit::BitToBlob(string_t bit) {
D_ASSERT(bit.GetSize() > 1);

auto buffer = make_unsafe_uniq_array_for_override<char>(bit.GetSize() - 1);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(bit.GetSize() - 1);
string_t output_str(buffer.get(), UnsafeNumericCast<uint32_t>(bit.GetSize() - 1));
Bit::BitToBlob(bit, output_str);
return output_str.GetString();
Expand Down
4 changes: 2 additions & 2 deletions src/common/types/blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void Blob::ToString(string_t blob, char *output) {

string Blob::ToString(string_t blob) {
auto str_len = GetStringSize(blob);
auto buffer = make_unsafe_uniq_array_for_override<char>(str_len);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(str_len);
Blob::ToString(blob, buffer.get());
return string(buffer.get(), str_len);
}
Expand Down Expand Up @@ -151,7 +151,7 @@ string Blob::ToBlob(string_t str) {

string Blob::ToBlob(string_t str, CastParameters &parameters) {
auto blob_len = GetBlobSize(str, parameters);
auto buffer = make_unsafe_uniq_array_for_override<char>(blob_len);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(blob_len);
Blob::ToBlob(str, data_ptr_cast(buffer.get()));
return string(buffer.get(), blob_len);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ string Date::ToString(date_t date) {
Date::Convert(date, date_units[0], date_units[1], date_units[2]);

auto length = DateToStringCast::Length(date_units, year_length, add_bc);
auto buffer = make_unsafe_uniq_array_for_override<char>(length);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(length);
DateToStringCast::Format(buffer.get(), date_units, year_length, add_bc);
return string(buffer.get(), length);
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/decimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ string Decimal::ToString(int64_t value, uint8_t width, uint8_t scale) {

string Decimal::ToString(hugeint_t value, uint8_t width, uint8_t scale) {
auto len = DecimalToString::DecimalLength(value, width, scale);
auto data = make_unsafe_uniq_array_for_override<char>(UnsafeNumericCast<size_t>(len + 1));
auto data = make_unsafe_uniq_array_uninitialized<char>(UnsafeNumericCast<size_t>(len + 1));
DecimalToString::FormatDecimal(value, width, scale, data.get(), UnsafeNumericCast<idx_t>(len));
return string(data.get(), UnsafeNumericCast<uint32_t>(len));
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/selection_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace duckdb {

SelectionData::SelectionData(idx_t count) {
owned_data = make_unsafe_uniq_array_for_override<sel_t>(count);
owned_data = make_unsafe_uniq_array_uninitialized<sel_t>(count);
#ifdef DEBUG
for (idx_t i = 0; i < count; i++) {
owned_data[i] = std::numeric_limits<sel_t>::max();
Expand Down
2 changes: 1 addition & 1 deletion src/common/types/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ string Time::ToString(dtime_t time) {

char micro_buffer[6];
auto length = TimeToStringCast::Length(time_units, micro_buffer);
auto buffer = make_unsafe_uniq_array_for_override<char>(length);
auto buffer = make_unsafe_uniq_array_uninitialized<char>(length);
TimeToStringCast::Format(buffer.get(), length, time_units, micro_buffer);
return string(buffer.get(), length);
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/types/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void Vector::Resize(idx_t current_size, idx_t new_size) {
}

// Copy the data buffer to a resized buffer.
auto new_data = make_unsafe_uniq_array_for_override<data_t>(target_size);
auto new_data = make_unsafe_uniq_array_uninitialized<data_t>(target_size);
memcpy(new_data.get(), resize_info_entry.data, old_size);
resize_info_entry.buffer->SetData(std::move(new_data));
resize_info_entry.vec.data = resize_info_entry.buffer->GetData();
Expand Down Expand Up @@ -1187,7 +1187,7 @@ void Vector::Serialize(Serializer &serializer, idx_t count) {
if (TypeIsConstantSize(logical_type.InternalType())) {
// constant size type: simple copy
idx_t write_size = GetTypeIdSize(logical_type.InternalType()) * count;
auto ptr = make_unsafe_uniq_array_for_override<data_t>(write_size);
auto ptr = make_unsafe_uniq_array_uninitialized<data_t>(write_size);
VectorOperations::WriteToStorage(*this, count, ptr.get());
serializer.WriteProperty(102, "data", ptr.get(), write_size);
} else {
Expand Down Expand Up @@ -1217,7 +1217,7 @@ void Vector::Serialize(Serializer &serializer, idx_t count) {
auto list_size = ListVector::GetListSize(*this);

// serialize the list entries in a flat array
auto entries = make_unsafe_uniq_array_for_override<list_entry_t>(count);
auto entries = make_unsafe_uniq_array_uninitialized<list_entry_t>(count);
auto source_array = UnifiedVectorFormat::GetData<list_entry_t>(vdata);
for (idx_t i = 0; i < count; i++) {
auto idx = vdata.sel->get_index(i);
Expand Down Expand Up @@ -1271,7 +1271,7 @@ void Vector::Deserialize(Deserializer &deserializer, idx_t count) {
if (TypeIsConstantSize(logical_type.InternalType())) {
// constant size type: read fixed amount of data
auto column_size = GetTypeIdSize(logical_type.InternalType()) * count;
auto ptr = make_unsafe_uniq_array_for_override<data_t>(column_size);
auto ptr = make_unsafe_uniq_array_uninitialized<data_t>(column_size);
deserializer.ReadProperty(102, "data", ptr.get(), column_size);

VectorOperations::ReadFromStorage(ptr.get(), count, *this);
Expand Down
2 changes: 1 addition & 1 deletion src/core_functions/aggregate/holistic/approx_top_k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct ApproxTopKState {
D_ASSERT(lookup_map.empty());
k = kval;
capacity = kval * MONITORED_VALUES_RATIO;
stored_values = make_unsafe_uniq_array_for_override<ApproxTopKValue>(capacity);
stored_values = make_unsafe_uniq_array_uninitialized<ApproxTopKValue>(capacity);
values.reserve(capacity);

// we scale the filter based on the amount of values we are monitoring
Expand Down
2 changes: 1 addition & 1 deletion src/core_functions/scalar/list/list_aggregates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static void ListAggregatesFunction(DataChunk &args, ExpressionState &state, Vect

// state_buffer holds the state for each list of this chunk
idx_t size = aggr.function.state_size();
auto state_buffer = make_unsafe_uniq_array_for_override<data_t>(size * count);
auto state_buffer = make_unsafe_uniq_array_uninitialized<data_t>(size * count);

// state vector for initialize and finalize
StateVector state_vector(count, info.aggr_expr->Copy());
Expand Down
2 changes: 1 addition & 1 deletion src/execution/aggregate_hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ idx_t GroupedAggregateHashTable::FindOrCreateGroupsInternal(DataChunk &groups, V
auto &chunk_state = state.append_state.chunk_state;
TupleDataCollection::ToUnifiedFormat(chunk_state, state.group_chunk);
if (!state.group_data) {
state.group_data = make_unsafe_uniq_array_for_override<UnifiedVectorFormat>(state.group_chunk.ColumnCount());
state.group_data = make_unsafe_uniq_array_uninitialized<UnifiedVectorFormat>(state.group_chunk.ColumnCount());
}
TupleDataCollection::GetVectorData(chunk_state, state.group_data.get());

Expand Down
4 changes: 2 additions & 2 deletions src/execution/join_hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ JoinHashTable::JoinHashTable(BufferManager &buffer_manager_p, const vector<JoinC
sink_collection =
make_uniq<RadixPartitionedTupleData>(buffer_manager, layout, radix_bits, layout.ColumnCount() - 1);

dead_end = make_unsafe_uniq_array_for_override<data_t>(layout.GetRowWidth());
dead_end = make_unsafe_uniq_array_uninitialized<data_t>(layout.GetRowWidth());
memset(dead_end.get(), 0, layout.GetRowWidth());
}

Expand Down Expand Up @@ -751,7 +751,7 @@ void JoinHashTable::Probe(ScanStructure &scan_structure, DataChunk &keys, TupleD
ScanStructure::ScanStructure(JoinHashTable &ht_p, TupleDataChunkState &key_state_p)
: key_state(key_state_p), pointers(LogicalType::POINTER), sel_vector(STANDARD_VECTOR_SIZE),
chain_match_sel_vector(STANDARD_VECTOR_SIZE), chain_no_match_sel_vector(STANDARD_VECTOR_SIZE),
found_match(make_unsafe_uniq_array_for_override<bool>(STANDARD_VECTOR_SIZE)), ht(ht_p), finished(false),
found_match(make_unsafe_uniq_array_uninitialized<bool>(STANDARD_VECTOR_SIZE)), ht(ht_p), finished(false),
is_null(true) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ UngroupedAggregateState::UngroupedAggregateState(const vector<unique_ptr<Express
auto &aggregate = aggregate_expressions[i];
D_ASSERT(aggregate->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
auto state = make_unsafe_uniq_array_for_override<data_t>(aggr.function.state_size());
auto state = make_unsafe_uniq_array_uninitialized<data_t>(aggr.function.state_size());
aggr.function.initialize(state.get());
aggregate_data.push_back(std::move(state));
bind_data.push_back(aggr.bind_info.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m

// Setup the NullStr information
null_str_count = state_machine.options.null_str.size();
null_str_ptr = make_unsafe_uniq_array_for_override<const char *>(null_str_count);
null_str_size = make_unsafe_uniq_array_for_override<idx_t>(null_str_count);
null_str_ptr = make_unsafe_uniq_array_uninitialized<const char *>(null_str_count);
null_str_size = make_unsafe_uniq_array_uninitialized<idx_t>(null_str_count);
for (idx_t i = 0; i < null_str_count; i++) {
null_str_ptr[i] = state_machine.options.null_str[i].c_str();
null_str_size[i] = state_machine.options.null_str[i].size();
Expand Down
2 changes: 1 addition & 1 deletion src/execution/operator/join/outer_join_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void OuterJoinMarker::Initialize(idx_t count_p) {
return;
}
this->count = count_p;
found_match = make_unsafe_uniq_array_for_override<bool>(count);
found_match = make_unsafe_uniq_array_uninitialized<bool>(count);
Reset();
}

Expand Down
2 changes: 1 addition & 1 deletion src/execution/operator/join/perfect_hash_join_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bool PerfectHashJoinExecutor::BuildPerfectHashTable(LogicalType &key_type) {
}

// and for duplicate_checking
bitmap_build_idx = make_unsafe_uniq_array_for_override<bool>(build_size);
bitmap_build_idx = make_unsafe_uniq_array_uninitialized<bool>(build_size);
memset(bitmap_build_idx.get(), 0, sizeof(bool) * build_size); // set false

// Now fill columns with build data
Expand Down
2 changes: 1 addition & 1 deletion src/execution/operator/join/physical_range_join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void PhysicalRangeJoin::GlobalSortedTable::Combine(LocalSortedTable &ltable) {
}

void PhysicalRangeJoin::GlobalSortedTable::IntializeMatches() {
found_match = make_unsafe_uniq_array_for_override<bool>(Count());
found_match = make_unsafe_uniq_array_uninitialized<bool>(Count());
memset(found_match.get(), 0, sizeof(bool) * Count());
}

Expand Down
4 changes: 2 additions & 2 deletions src/execution/perfect_aggregate_hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ PerfectAggregateHashTable::PerfectAggregateHashTable(ClientContext &context, All
tuple_size = layout.GetRowWidth();

// allocate and null initialize the data
owned_data = make_unsafe_uniq_array_for_override<data_t>(tuple_size * total_groups);
owned_data = make_unsafe_uniq_array_uninitialized<data_t>(tuple_size * total_groups);
data = owned_data.get();

// set up the empty payloads for every tuple, and initialize the "occupied" flag to false
group_is_set = make_unsafe_uniq_array_for_override<bool>(total_groups);
group_is_set = make_unsafe_uniq_array_uninitialized<bool>(total_groups);
memset(group_is_set.get(), 0, total_groups * sizeof(bool));

// initialize the hash table for each entry
Expand Down
2 changes: 1 addition & 1 deletion src/execution/radix_partitioned_hashtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ SourceResultType RadixPartitionedHashTable::GetData(ExecutionContext &context, D
for (idx_t i = 0; i < op.aggregates.size(); i++) {
D_ASSERT(op.aggregates[i]->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
auto &aggr = op.aggregates[i]->Cast<BoundAggregateExpression>();
auto aggr_state = make_unsafe_uniq_array_for_override<data_t>(aggr.function.state_size());
auto aggr_state = make_unsafe_uniq_array_uninitialized<data_t>(aggr.function.state_size());
aggr.function.initialize(aggr_state.get());

AggregateInputData aggr_input_data(aggr.bind_info.get(), allocator);
Expand Down
4 changes: 2 additions & 2 deletions src/execution/window_segment_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ void WindowSegmentTreeGlobalState::ConstructTree() {
level_nodes = (level_nodes + (TREE_FANOUT - 1)) / TREE_FANOUT;
internal_nodes += level_nodes;
} while (level_nodes > 1);
levels_flat_native = make_unsafe_uniq_array_for_override<data_t>(internal_nodes * tree.state_size);
levels_flat_native = make_unsafe_uniq_array_uninitialized<data_t>(internal_nodes * tree.state_size);
levels_flat_start.push_back(0);

idx_t levels_flat_offset = 0;
Expand Down Expand Up @@ -1629,7 +1629,7 @@ WindowDistinctAggregatorGlobalState::DistinctSortTree::DistinctSortTree(ZippedEl
for (idx_t level_nr = 0; level_nr < zipped_tree.tree.size(); ++level_nr) {
internal_nodes += zipped_tree.tree[level_nr].first.size();
}
levels_flat_native = make_unsafe_uniq_array_for_override<data_t>(internal_nodes * state_size);
levels_flat_native = make_unsafe_uniq_array_uninitialized<data_t>(internal_nodes * state_size);
levels_flat_start.push_back(0);
idx_t levels_flat_offset = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/function/scalar/strftime_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ string StrfTimeFormat::Format(timestamp_t timestamp, const string &format_str) {
auto time = Timestamp::GetTime(timestamp);

auto len = format.GetLength(date, time, 0, nullptr);
auto result = make_unsafe_uniq_array_for_override<char>(len);
auto result = make_unsafe_uniq_array_uninitialized<char>(len);
format.FormatString(date, time, result.get());
return string(result.get(), len);
}
Expand Down
2 changes: 1 addition & 1 deletion src/function/scalar/string/concat_ws.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static void TemplatedConcatWS(DataChunk &args, const string_t *sep_data, const S
vector<bool> has_results(args.size(), false);

// we overallocate here, but this is important for static analysis
auto orrified_data = make_unsafe_uniq_array_for_override<UnifiedVectorFormat>(args.ColumnCount());
auto orrified_data = make_unsafe_uniq_array_uninitialized<UnifiedVectorFormat>(args.ColumnCount());

for (idx_t col_idx = 1; col_idx < args.ColumnCount(); col_idx++) {
args.data[col_idx].ToUnifiedFormat(args.size(), orrified_data[col_idx - 1]);
Expand Down
4 changes: 2 additions & 2 deletions src/function/scalar/string/like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ bool ILikeOperatorFunction(string_t &str, string_t &pattern, char escape = '\0')

// lowercase both the str and the pattern
idx_t str_llength = LowerFun::LowerLength(str_data, str_size);
auto str_ldata = make_unsafe_uniq_array_for_override<char>(str_llength);
auto str_ldata = make_unsafe_uniq_array_uninitialized<char>(str_llength);
LowerFun::LowerCase(str_data, str_size, str_ldata.get());

idx_t pat_llength = LowerFun::LowerLength(pat_data, pat_size);
auto pat_ldata = make_unsafe_uniq_array_for_override<char>(pat_llength);
auto pat_ldata = make_unsafe_uniq_array_uninitialized<char>(pat_llength);
LowerFun::LowerCase(pat_data, pat_size, pat_ldata.get());
string_t str_lcase(str_ldata.get(), UnsafeNumericCast<uint32_t>(str_llength));
string_t pat_lcase(pat_ldata.get(), UnsafeNumericCast<uint32_t>(pat_llength));
Expand Down
Loading

0 comments on commit 4bdd2b5

Please sign in to comment.