diff options
Diffstat (limited to 'source/blender/blenlib/intern/BLI_index_range.cc')
-rw-r--r-- | source/blender/blenlib/intern/BLI_index_range.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenlib/intern/BLI_index_range.cc b/source/blender/blenlib/intern/BLI_index_range.cc index 9fa19143f91..a906416b491 100644 --- a/source/blender/blenlib/intern/BLI_index_range.cc +++ b/source/blender/blenlib/intern/BLI_index_range.cc @@ -24,28 +24,28 @@ namespace blender { -static Vector<Array<uint, 0, RawAllocator>, 1, RawAllocator> arrays; -static uint current_array_size = 0; -static uint *current_array = nullptr; +static Vector<Array<int64_t, 0, RawAllocator>, 1, RawAllocator> arrays; +static int64_t current_array_size = 0; +static int64_t *current_array = nullptr; static std::mutex current_array_mutex; -Span<uint> IndexRange::as_span() const +Span<int64_t> IndexRange::as_span() const { - uint min_required_size = start_ + size_; + int64_t min_required_size = start_ + size_; if (min_required_size <= current_array_size) { - return Span<uint>(current_array + start_, size_); + return Span<int64_t>(current_array + start_, size_); } std::lock_guard<std::mutex> lock(current_array_mutex); if (min_required_size <= current_array_size) { - return Span<uint>(current_array + start_, size_); + return Span<int64_t>(current_array + start_, size_); } - uint new_size = std::max<uint>(1000, power_of_2_max_u(min_required_size)); - Array<uint, 0, RawAllocator> new_array(new_size); - for (uint i = 0; i < new_size; i++) { + int64_t new_size = std::max<int64_t>(1000, power_of_2_max_u(min_required_size)); + Array<int64_t, 0, RawAllocator> new_array(new_size); + for (int64_t i = 0; i < new_size; i++) { new_array[i] = i; } arrays.append(std::move(new_array)); @@ -54,7 +54,7 @@ Span<uint> IndexRange::as_span() const std::atomic_thread_fence(std::memory_order_seq_cst); current_array_size = new_size; - return Span<uint>(current_array + start_, size_); + return Span<int64_t>(current_array + start_, size_); } } // namespace blender |