| /xnu-11215/tools/kt-dump/ |
| H A D | kt-dump.cpp | 182 std::set<std::pair<const char *, const char *> > dedup_entries; 251 std::cout << std::endl << indent << " ]"; in dump_types() 331 std::cout << std::endl << indent << " ]"; in dump_types_var() 392 std::string 447 std::cout << std::endl << indent << "}"; in dump() 455 std::cout << indent << "__kalloc_type: " << std::endl; in dump() 465 std::cout << indent << "__kalloc_var: " << std::endl; in dump() 509 std::cout << std::endl; in do_fat_macho() 554 std::cout << std::endl; in do_fileset() 570 std::ifstream file(path, std::ifstream::binary); in read_file() [all …]
|
| /xnu-11215/libkern/os/ |
| H A D | cxx_safe_buffers.h | 50 std::span<std::remove_reference_t<std::iter_reference_t<It> > > 51 __unsafe_forge_span(It data, typename std::span<std::remove_reference_t<std::iter_reference_t<It> >… in __unsafe_forge_span() 53 return std::span<std::remove_reference_t<std::iter_reference_t<It> > > in __unsafe_forge_span() 57 template<std::contiguous_iterator It, std::sized_sentinel_for<It> End> 58 std::span<std::remove_reference_t<std::iter_reference_t<It> > > 61 return std::span<std::remove_reference_t<std::iter_reference_t<It> > >{begin, end}; in __unsafe_forge_span()
|
| H A D | atomic.h | 68 #define OS_ATOMIC_STD std:: 69 #define os_atomic_std(op) std::op 70 #define os_atomic(type) std::atomic<type> volatile 97 inline volatile std::atomic<remove_volatile_t<T> > * 104 inline volatile std::atomic<remove_volatile_t<T> > * 105 cast_to_atomic_pointer(std::atomic<T> *v) in cast_to_atomic_pointer() 111 inline volatile std::atomic<remove_volatile_t<T> > * 112 cast_to_atomic_pointer(volatile std::atomic<T> *v) in cast_to_atomic_pointer() 126 cast_to_nonatomic_pointer(std::atomic<T> *v) in cast_to_nonatomic_pointer() 133 cast_to_nonatomic_pointer(volatile std::atomic<T> *v) in cast_to_nonatomic_pointer() [all …]
|
| /xnu-11215/tests/safe_allocation_src/ |
| H A D | test_utils.h | 25 return std::malloc(n); in allocate() 32 std::memset(result, 0, n); in allocate_zero() 39 std::free(p); in deallocate() 52 static std::size_t allocated_size; 53 static std::size_t deallocated_size; 58 allocate(std::size_t n) in allocate() 62 return std::malloc(n); in allocate() 66 allocate_zero(std::size_t n) in allocate_zero() 69 std::memset(result, 0, n); in allocate_zero() 74 deallocate(void* p, std::size_t n) in deallocate() [all …]
|
| H A D | size.cpp | 40 using Size = decltype(std::declval<test_safe_allocation<T> const&>().size()); in tests() 41 static_assert(std::is_same_v<Size, std::size_t>); in tests()
|
| H A D | assign.move.cpp | 28 tracked_safe_allocation<T>& ref = (to = std::move(from)); in tests() 53 tracked_safe_allocation<T>& ref = (to = std::move(from)); in tests() 79 tracked_safe_allocation<T>& ref = (to = std::move(from)); in tests() 104 tracked_safe_allocation<T>& ref = (to = std::move(from)); in tests() 128 tracked_safe_allocation<T>& ref = (obj = std::move(obj)); in tests()
|
| H A D | ctor.move.cpp | 28 tracked_safe_allocation<T> to(std::move(from)); in tests() 48 tracked_safe_allocation<T> to{std::move(from)}; in tests() 68 tracked_safe_allocation<T> to = std::move(from); in tests() 88 tracked_safe_allocation<T> to(std::move(from)); in tests()
|
| H A D | ctor.allocate.cpp | 42 std::size_t max_n = std::numeric_limits<std::size_t>::max() / sizeof(T); in tests()
|
| /xnu-11215/tests/bounded_ptr_src/ |
| H A D | example.malloc.cpp | 18 bounded_malloc(std::size_t size) in bounded_malloc() 20 void* p = std::malloc(size); in bounded_malloc() 29 std::free(ptr.discard_bounds()); in bounded_free() 33 std::uint32_t idx; 48 std::exit(EXIT_FAILURE); in require() 54 std::uint32_t count = 100; 55 std::uint32_t alloc_size = count * sizeof(SomeType); 64 for (std::uint32_t i = 0; i < count; i++) { 65 std::uint32_t& idx = array[i].idx;
|
| H A D | arith.add_assign.cpp | 35 std::array<T, 5> array = {T{0}, T{1}, T{2}, T{3}, T{4}}; in tests() 123 std::ptrdiff_t sizeof_T = sizeof(T); // avoid promotion to unsigned in calculations in tests() 126 std::ptrdiff_t max_n = std::numeric_limits<std::ptrdiff_t>::max() / sizeof_T; in tests() 129 std::ptrdiff_t min_n = std::numeric_limits<std::ptrdiff_t>::min() / sizeof_T; in tests() 157 std::int64_t sizeof_T = sizeof(T); // avoid promotion to unsigned in calculations in tests() 160 std::int64_t max_n = std::numeric_limits<std::int32_t>::max() / sizeof_T; in tests() 163 std::int64_t min_n = std::numeric_limits<std::int32_t>::min() / sizeof_T; in tests()
|
| H A D | arith.subtract_assign.cpp | 32 std::array<T, 5> array = {T{0}, T{1}, T{2}, T{3}, T{4}}; in tests() 120 std::ptrdiff_t sizeof_T = sizeof(T); // avoid promotion to unsigned in calculations in tests() 123 std::ptrdiff_t max_n = std::numeric_limits<std::ptrdiff_t>::max() / sizeof_T; in tests() 126 std::ptrdiff_t min_n = std::numeric_limits<std::ptrdiff_t>::min() / sizeof_T; in tests() 154 std::int64_t sizeof_T = sizeof(T); // avoid promotion to unsigned in calculations in tests() 157 std::int64_t max_n = std::numeric_limits<std::int32_t>::max() / sizeof_T; in tests() 160 std::int64_t min_n = std::numeric_limits<std::int32_t>::min() / sizeof_T; in tests()
|
| H A D | ctor.convert.cpp | 46 std::array<Stored, 5> array = {Stored{0}, Stored{1}, Stored{2}, Stored{3}, Stored{4}}; in tests() 122 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Base>, /*to*/ test_bounded_ptr<Deri… 123 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Base1>, /*to*/ test_bounded_ptr<Der… 125 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Base1>, /*to*/ test_bounded_ptr<Bas… 131 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Derived>, /*to*/ test_bounded_ptr<c… 132 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Derived>, /*to*/ test_bounded_ptr<U… 133 …static_assert(!std::is_convertible_v</*from*/ test_bounded_ptr<Base1>, /*to*/ test_bounded_ptr<Bas… 136 …static_assert(!std::is_constructible_v</*to*/ test_bounded_ptr<char>, /*from*/ test_bounded_ptr<De… 137 …static_assert(!std::is_constructible_v</*to*/ test_bounded_ptr<Unrelated>, /*from*/ test_bounded_p… 138 …static_assert(!std::is_constructible_v</*to*/ test_bounded_ptr<Base2>, /*from*/ test_bounded_ptr<B… [all …]
|
| H A D | arith.difference.cpp | 30 std::ptrdiff_t diff = a - b; in tests() 36 std::ptrdiff_t diff = a - b; in tests() 42 std::ptrdiff_t diff = a - b; in tests() 48 std::ptrdiff_t diff = a - b; in tests() 54 std::ptrdiff_t diff = a - b; in tests() 60 std::ptrdiff_t diff = a - b; in tests() 68 std::ptrdiff_t diff = a - b; in tests() 74 std::ptrdiff_t diff = a - b; in tests() 80 std::ptrdiff_t diff = a - b; in tests() 86 std::ptrdiff_t diff = a - b; in tests() [all …]
|
| H A D | assign.convert.cpp | 45 std::array<Stored, 5> array = {Stored{0}, Stored{1}, Stored{2}, Stored{3}, Stored{4}}; in tests() 125 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Derived>, /*from*/ test_bounded_ptr<Ba… 126 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<DerivedMultiple>, /*from*/ test_bounde… 127 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<DerivedMultiple>, /*from*/ test_bounde… 128 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Base2>, /*from*/ test_bounded_ptr<Base… 131 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Derived>, /*from*/ test_bounded_ptr<De… 134 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<char>, /*from*/ test_bounded_ptr<Deriv… 135 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Unrelated>, /*from*/ test_bounded_ptr<… 136 …static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Base2>, /*from*/ test_bounded_ptr<Base… 139 static_assert(!std::is_assignable_v</*to*/ test_bounded_ptr<Derived>, /*from*/ Derived*>);
|
| H A D | unsafe_discard_bounds.cpp | 35 std::array<T, 5> array = {T{0}, T{1}, T{2}, T{3}, T{4}}; in tests() 126 QualT* end_of_memory = reinterpret_cast<QualT*>(std::numeric_limits<std::uintptr_t>::max()); in tests() 128 std::ptrdiff_t offset = 501; in tests()
|
| H A D | arith.subtract.cpp | 23 std::array<T, 5> array = {T{0}, T{1}, T{2}, T{3}, T{4}}; in tests() 34 test_bounded_ptr<QualT> res = ptr - static_cast<std::ptrdiff_t>(0); in tests() 68 test_bounded_ptr<QualT> res = ptr - static_cast<std::ptrdiff_t>(0); in tests()
|
| /xnu-11215/tests/intrusive_shared_ptr_src/ |
| H A D | ctor.move.cpp | 42 libkern::intrusive_shared_ptr<To, test_policy> to(std::move(from)); // explicit in tests() 53 libkern::intrusive_shared_ptr<To, test_policy> to{std::move(from)}; // explicit in tests() 64 libkern::intrusive_shared_ptr<To, test_policy> to = std::move(from); // implicit in tests() 74 libkern::intrusive_shared_ptr<To, test_policy> to = std::move(from); in tests() 97 static_assert(std::is_move_constructible_v<test_shared_ptr<Derived> >); 100 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<B… 101 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shar… 103 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Bas… 109 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<char>, /*from*/ test_shared_ptr<Deri… 110 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Unrelated>, /*from*/ test_shared_ptr… [all …]
|
| H A D | assign.move.cpp | 40 tracked_shared_ptr<To>& ref = (to = std::move(from)); in tests() 53 tracked_shared_ptr<To>& ref = (to = std::move(from)); in tests() 66 tracked_shared_ptr<To>& ref = (to = std::move(from)); in tests() 79 tracked_shared_ptr<To>& ref = (to = std::move(from)); in tests() 104 static_assert(std::is_move_assignable_v<test_shared_ptr<Derived> >); 107 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<Base… 108 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shared_… 110 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Base1>… 116 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<char>, /*from*/ test_shared_ptr<Derived… 117 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Unrelated>, /*from*/ test_shared_ptr<De… [all …]
|
| H A D | ctor.copy.cpp | 83 static_assert(std::is_copy_constructible_v<test_shared_ptr<Derived> >); 86 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<B… 87 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shar… 88 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shar… 89 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Bas… 92 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<D… 95 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<char>, /*from*/ test_shared_ptr<Deri… 96 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Unrelated>, /*from*/ test_shared_ptr… 97 …static_assert(!std::is_constructible_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Bas… 100 …static_assert(!std::is_constructible_v</*to*/ libkern::intrusive_shared_ptr<Derived, dummy_policy<…
|
| H A D | assign.copy.cpp | 103 static_assert(std::is_copy_assignable_v<test_shared_ptr<Derived> >); 106 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<Base… 107 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shared_… 108 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<DerivedMultiple>, /*from*/ test_shared_… 109 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Base1>… 112 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Derived>, /*from*/ test_shared_ptr<Deri… 115 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<char>, /*from*/ test_shared_ptr<Derived… 116 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Unrelated>, /*from*/ test_shared_ptr<De… 117 …static_assert(!std::is_assignable_v</*to*/ test_shared_ptr<Base2>, /*from*/ test_shared_ptr<Base1>… 120 …static_assert(!std::is_assignable_v</*to*/ libkern::intrusive_shared_ptr<Derived, dummy_policy<2> …
|
| /xnu-11215/tests/bounded_array_ref_src/ |
| H A D | size.cpp | 21 test_bounded_array_ref<T> const view(&array[0], static_cast<std::size_t>(0)); in tests() 22 std::size_t size = view.size(); in tests() 27 std::size_t size = view.size(); in tests() 32 std::size_t size = view.size(); in tests() 37 std::size_t size = view.size(); in tests()
|
| H A D | ctor.raw_ptr.cpp | 74 test_bounded_array_ref<T> view(ptr, static_cast<std::size_t>(0)); in tests() 80 test_bounded_array_ref<T> view(ptr, static_cast<std::size_t>(0)); in tests() 86 test_bounded_array_ref<T> view(ptr, static_cast<std::size_t>(0)); in tests() 92 std::ptrdiff_t size = 5; in tests()
|
| H A D | slice.cpp | 184 std::uint32_t n = std::numeric_limits<std::uint32_t>::max() / 2 + 1; in tests() 185 std::uint32_t m = std::numeric_limits<std::uint32_t>::max() / 2 + 1; in tests()
|
| H A D | test_policy.h | 23 static std::string message; 38 std::string tracking_policy::message = "";
|
| /xnu-11215/tests/cxx_safe_buffers_src/ |
| H A D | unsafe_forge_span.cpp | 23 std::span<T> span = os::span::__unsafe_forge_span(p, 10); in tests() 29 std::vector<T> v; in tests() 30 std::span<T> span = os::span::__unsafe_forge_span(v.begin(), v.end()); in tests()
|