15 std::atomic<int64_t> IndexRange::s_current_array_size = 0;
16 std::atomic<int64_t *> IndexRange::s_current_array =
nullptr;
20 int64_t min_required_size = start_ + size_;
25 if (min_required_size <= s_current_array_size) {
38 arrays.append(std::move(new_array));
40 s_current_array.store(
arrays.last().data(), std::memory_order_release);
41 s_current_array_size.store(new_size, std::memory_order_release);
MINLINE unsigned int power_of_2_max_u(unsigned int x)
constexpr IndexRange()=default
void isolate_task(const Function &function)
void parallel_for(IndexRange range, int64_t grain_size, const Function &function)
static RawVector< RawArray< int64_t, 0 > > arrays
static std::mutex current_array_mutex