Lines Matching refs:std
33 TBB_EXPORT void* __TBB_EXPORTED_FUNC cache_aligned_allocate(std::size_t size);
35 TBB_EXPORT std::size_t __TBB_EXPORTED_FUNC cache_line_size();
44 using propagate_on_container_move_assignment = std::true_type;
47 using is_always_equal = std::true_type;
53 __TBB_nodiscard T* allocate(std::size_t n) { in allocate()
58 void deallocate(T* p, std::size_t) { in deallocate()
63 std::size_t max_size() const noexcept { in max_size()
64 return (~std::size_t(0) - r1::cache_line_size()) / sizeof(value_type); in max_size()
72 using difference_type = std::ptrdiff_t;
73 using size_type = std::size_t;
79 { ::new (p) U(std::forward<Args>(args)...); } in construct()
110 class cache_aligned_resource : public std::pmr::memory_resource {
112 cache_aligned_resource() : cache_aligned_resource(std::pmr::get_default_resource()) {} in cache_aligned_resource()
113 explicit cache_aligned_resource(std::pmr::memory_resource* upstream) : m_upstream(upstream) {} in cache_aligned_resource()
115 std::pmr::memory_resource* upstream_resource() const { in upstream_resource()
121 void* do_allocate(std::size_t bytes, std::size_t alignment) override { in do_allocate()
123 std::size_t cache_line_alignment = correct_alignment(alignment); in do_allocate()
124 std::size_t space = correct_size(bytes) + cache_line_alignment; in do_allocate()
125 std::uintptr_t base = reinterpret_cast<std::uintptr_t>(m_upstream->allocate(space)); in do_allocate()
129 std::uintptr_t result = (base + cache_line_alignment) & ~(cache_line_alignment - 1); in do_allocate()
130 …__TBB_ASSERT((result - base) >= sizeof(std::uintptr_t), "Can`t store a base pointer to the header"… in do_allocate()
134 (reinterpret_cast<std::uintptr_t*>(result))[-1] = base; in do_allocate()
138 void do_deallocate(void* ptr, std::size_t bytes, std::size_t alignment) override { in do_deallocate()
141 std::uintptr_t base = (reinterpret_cast<std::uintptr_t*>(ptr))[-1]; in do_deallocate()
146 bool do_is_equal(const std::pmr::memory_resource& other) const noexcept override { in do_is_equal()
156 std::size_t correct_alignment(std::size_t alignment) { in correct_alignment()
159 std::size_t cache_line_size = std::hardware_destructive_interference_size; in correct_alignment()
161 std::size_t cache_line_size = r1::cache_line_size(); in correct_alignment()
166 std::size_t correct_size(std::size_t bytes) { in correct_size()
169 return bytes < sizeof(std::uintptr_t) ? sizeof(std::uintptr_t) : bytes; in correct_size()
172 std::pmr::memory_resource* m_upstream;