/external/llvm-project/llvm/unittests/Support/ |
D | AllocatorTest.cpp | 18 BumpPtrAllocator Alloc; in TEST() local 19 int *a = (int*)Alloc.Allocate(sizeof(int), alignof(int)); in TEST() 20 int *b = (int*)Alloc.Allocate(sizeof(int) * 10, alignof(int)); in TEST() 21 int *c = (int*)Alloc.Allocate(sizeof(int), alignof(int)); in TEST() 30 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST() 32 BumpPtrAllocator Alloc2 = std::move(Alloc); in TEST() 33 EXPECT_EQ(0U, Alloc.GetNumSlabs()); in TEST() 43 Alloc = std::move(Alloc2); in TEST() 45 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST() 50 BumpPtrAllocator Alloc; in TEST() local [all …]
|
/external/llvm/unittests/Support/ |
D | AllocatorTest.cpp | 19 BumpPtrAllocator Alloc; in TEST() local 20 int *a = (int*)Alloc.Allocate(sizeof(int), 1); in TEST() 21 int *b = (int*)Alloc.Allocate(sizeof(int) * 10, 1); in TEST() 22 int *c = (int*)Alloc.Allocate(sizeof(int), 1); in TEST() 31 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST() 33 BumpPtrAllocator Alloc2 = std::move(Alloc); in TEST() 34 EXPECT_EQ(0U, Alloc.GetNumSlabs()); in TEST() 44 Alloc = std::move(Alloc2); in TEST() 46 EXPECT_EQ(1U, Alloc.GetNumSlabs()); in TEST() 51 BumpPtrAllocator Alloc; in TEST() local [all …]
|
/external/llvm-project/llvm/unittests/CodeGen/ |
D | DIEHashTest.cpp | 28 BumpPtrAllocator Alloc; member in __anona180f17d0111::DIEHashTest 57 DIE &Die = *DIE::get(Alloc, dwarf::DW_TAG_base_type); in TEST_F() 59 Die.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, Size); in TEST_F() 66 DIE &Unnamed = *DIE::get(Alloc, dwarf::DW_TAG_structure_type); in TEST_F() 68 Unnamed.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, One); in TEST_F() 71 Unnamed.addValue(Alloc, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data1, One); in TEST_F() 72 Unnamed.addValue(Alloc, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data1, One); in TEST_F() 81 DIE &Foo = *DIE::get(Alloc, dwarf::DW_TAG_structure_type); in TEST_F() 84 Foo.addValue(Alloc, dwarf::DW_AT_name, dwarf::DW_FORM_strp, FooStr); in TEST_F() 85 Foo.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, One); in TEST_F() [all …]
|
/external/llvm/unittests/CodeGen/ |
D | DIEHashTest.cpp | 26 BumpPtrAllocator Alloc; member in __anon92ecf24f0111::DIEHashTest 41 DIE &Die = *DIE::get(Alloc, dwarf::DW_TAG_base_type); in TEST_F() 43 Die.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, Size); in TEST_F() 50 DIE &Unnamed = *DIE::get(Alloc, dwarf::DW_TAG_structure_type); in TEST_F() 52 Unnamed.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, One); in TEST_F() 55 Unnamed.addValue(Alloc, dwarf::DW_AT_decl_file, dwarf::DW_FORM_data1, One); in TEST_F() 56 Unnamed.addValue(Alloc, dwarf::DW_AT_decl_line, dwarf::DW_FORM_data1, One); in TEST_F() 65 DIE &Foo = *DIE::get(Alloc, dwarf::DW_TAG_structure_type); in TEST_F() 68 Foo.addValue(Alloc, dwarf::DW_AT_name, dwarf::DW_FORM_strp, FooStr); in TEST_F() 69 Foo.addValue(Alloc, dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, One); in TEST_F() [all …]
|
/external/llvm-project/clang/test/Analysis/ |
D | malloc-annotations.cpp | 26 void af1(MemoryAllocator &Alloc) { in af1() argument 27 void *p = Alloc.my_malloc(12); in af1() 31 void af1_b(MemoryAllocator &Alloc) { in af1_b() argument 32 void *p = Alloc.my_malloc(12); in af1_b() 35 void af1_c(MemoryAllocator &Alloc) { in af1_c() argument 36 myglobalpointer = Alloc.my_malloc(12); // no-warning in af1_c() 40 void af1_e(MemoryAllocator &Alloc, void **pp) { in af1_e() argument 41 *pp = Alloc.my_malloc(42); // no-warning in af1_e() 44 void af1_f(MemoryAllocator &Alloc, struct stuff *somestuff) { in af1_f() argument 45 somestuff->somefield = Alloc.my_malloc(12); // no-warning in af1_f() [all …]
|
/external/libcxx/test/support/ |
D | uses_alloc_types.hpp | 58 template <class Alloc, std::size_t N> 65 template <class Alloc, std::size_t N> 71 template <class Alloc, std::size_t N> 77 template <class Alloc, std::size_t> 147 template <class Alloc> 149 using type = Alloc; 156 template <class Alloc, bool = std::is_default_constructible<Alloc>::value> 158 Alloc allocator; 160 UsesAllocatorTestBaseStorage(Alloc const& a) : allocator(a) {} in UsesAllocatorTestBaseStorage() 161 const Alloc* get_allocator() const { return &allocator; } in get_allocator() [all …]
|
/external/llvm-project/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/ |
D | destroy.pass.cpp | 89 typedef NoDestroy<CountDestructor> Alloc; in test() typedef 91 Alloc alloc; in test() 92 CountDestructor* pool = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 94 std::allocator_traits<Alloc>::construct(alloc, pool, &destructors); in test() 97 std::allocator_traits<Alloc>::destroy(alloc, pool); in test() 100 std::allocator_traits<Alloc>::deallocate(alloc, pool, 1); in test() 104 typedef NoDestroy<T> Alloc; in test() typedef 105 Alloc alloc; in test() 106 T* pool = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 107 std::allocator_traits<Alloc>::construct(alloc, pool, nullptr); in test() [all …]
|
/external/llvm-project/libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/ |
D | destroy_at.pass.cpp | 48 using Alloc = std::allocator<Counted>; in test() typedef 49 Alloc alloc; in test() 50 Counted* ptr1 = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 51 Counted* ptr2 = std::allocator_traits<Alloc>::allocate(alloc, 1); in test() 54 std::allocator_traits<Alloc>::construct(alloc, ptr1, &counter); in test() 55 std::allocator_traits<Alloc>::construct(alloc, ptr2, &counter); in test() 64 std::allocator_traits<Alloc>::deallocate(alloc, ptr1, 1); in test() 65 std::allocator_traits<Alloc>::deallocate(alloc, ptr2, 1); in test() 68 using Alloc = std::allocator<DerivedCounted>; in test() typedef 69 Alloc alloc; in test() [all …]
|
/external/llvm-project/libcxx/test/libcxx/containers/sequences/vector/vector.cons/ |
D | construct_iter_iter_alloc.pass.cpp | 25 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 26 Alloc a; in test_ctor_under_alloc() 28 Alloc::construct_called = false; in test_ctor_under_alloc() 30 assert(Alloc::construct_called); in test_ctor_under_alloc() 33 Alloc::construct_called = false; in test_ctor_under_alloc() 35 assert(Alloc::construct_called); in test_ctor_under_alloc() 40 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 41 Alloc a; in test_ctor_under_alloc() 43 Alloc::construct_called = false; in test_ctor_under_alloc() 45 assert(Alloc::construct_called); in test_ctor_under_alloc() [all …]
|
D | construct_iter_iter.pass.cpp | 24 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 26 Alloc::construct_called = false; in test_ctor_under_alloc() 28 assert(Alloc::construct_called); in test_ctor_under_alloc() 31 Alloc::construct_called = false; in test_ctor_under_alloc() 33 assert(Alloc::construct_called); in test_ctor_under_alloc() 38 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 40 Alloc::construct_called = false; in test_ctor_under_alloc() 42 assert(Alloc::construct_called); in test_ctor_under_alloc() 45 Alloc::construct_called = false; in test_ctor_under_alloc() 47 assert(Alloc::construct_called); in test_ctor_under_alloc()
|
/external/libcxx/test/libcxx/containers/sequences/vector/vector.cons/ |
D | construct_iter_iter_alloc.pass.cpp | 25 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 26 Alloc a; in test_ctor_under_alloc() 28 Alloc::construct_called = false; in test_ctor_under_alloc() 30 assert(Alloc::construct_called); in test_ctor_under_alloc() 33 Alloc::construct_called = false; in test_ctor_under_alloc() 35 assert(Alloc::construct_called); in test_ctor_under_alloc() 40 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 41 Alloc a; in test_ctor_under_alloc() 43 Alloc::construct_called = false; in test_ctor_under_alloc() 45 assert(Alloc::construct_called); in test_ctor_under_alloc() [all …]
|
D | construct_iter_iter.pass.cpp | 24 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 26 Alloc::construct_called = false; in test_ctor_under_alloc() 28 assert(Alloc::construct_called); in test_ctor_under_alloc() 31 Alloc::construct_called = false; in test_ctor_under_alloc() 33 assert(Alloc::construct_called); in test_ctor_under_alloc() 38 typedef C::allocator_type Alloc; in test_ctor_under_alloc() typedef 40 Alloc::construct_called = false; in test_ctor_under_alloc() 42 assert(Alloc::construct_called); in test_ctor_under_alloc() 45 Alloc::construct_called = false; in test_ctor_under_alloc() 47 assert(Alloc::construct_called); in test_ctor_under_alloc()
|
/external/llvm-project/libcxx/test/support/ |
D | uses_alloc_types.h | 57 template <class Alloc, std::size_t N> 64 template <class Alloc, std::size_t N> 70 template <class Alloc, std::size_t N> 76 template <class Alloc, std::size_t> 146 template <class Alloc> 148 using type = Alloc; 155 template <class Alloc, bool = std::is_default_constructible<Alloc>::value> 157 Alloc allocator; 159 UsesAllocatorTestBaseStorage(Alloc const& a) : allocator(a) {} 160 const Alloc* get_allocator() const { return &allocator; } [all …]
|
/external/crosvm/resources/src/ |
D | address_allocator.rs | 8 use crate::{Alloc, Error, Result}; 30 allocs: HashMap<Alloc, (u64, u64, String)>, 71 alloc: Alloc, in allocate_with_align() argument 121 pub fn allocate(&mut self, size: u64, alloc: Alloc, tag: String) -> Result<u64> { in allocate() argument 129 pub fn allocate_at(&mut self, start: u64, size: u64, alloc: Alloc, tag: String) -> Result<()> { in allocate_at() argument 161 pub fn release(&mut self, alloc: Alloc) -> Result<()> { in release() 168 pub fn get(&self, alloc: &Alloc) -> Option<&(u64, u64, String)> { in get() 220 pub fn address_from_pci_offset(&self, alloc: Alloc, offset: u64, size: u64) -> Result<u64> { in address_from_pci_offset() argument 222 Alloc::PciBar { .. } => (), in address_from_pci_offset() 257 alloc: Alloc, in allocate_with_align() argument [all …]
|
/external/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/ |
D | construct_pair_const_lvalue_pair.pass.cpp | 67 template <class Alloc, class TT, class UU> 71 using T = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 72 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 76 using T = UsesAllocatorV1<Alloc, 1>; in test_pmr_uses_allocator() 77 using U = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 81 using T = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 82 using U = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 86 using T = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 87 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 92 template <class Alloc, class TT, class UU> [all …]
|
D | construct_pair_rvalue.pass.cpp | 66 template <class Alloc, class TT, class UU> 70 using T = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 71 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 75 using T = UsesAllocatorV1<Alloc, 1>; in test_pmr_uses_allocator() 76 using U = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 80 using T = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 81 using U = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 85 using T = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 86 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 91 template <class Alloc, class TT, class UU> [all …]
|
/external/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/ |
D | construct_pair_const_lvalue_pair.pass.cpp | 69 template <class Alloc, class TT, class UU> 73 using T = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 74 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 78 using T = UsesAllocatorV1<Alloc, 1>; in test_pmr_uses_allocator() 79 using U = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 83 using T = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 84 using U = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 88 using T = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 89 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 94 template <class Alloc, class TT, class UU> [all …]
|
D | construct_pair_rvalue.pass.cpp | 68 template <class Alloc, class TT, class UU> 72 using T = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 73 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 77 using T = UsesAllocatorV1<Alloc, 1>; in test_pmr_uses_allocator() 78 using U = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 82 using T = UsesAllocatorV2<Alloc, 1>; in test_pmr_uses_allocator() 83 using U = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 87 using T = UsesAllocatorV3<Alloc, 1>; in test_pmr_uses_allocator() 88 using U = NotUsesAllocator<Alloc, 1>; in test_pmr_uses_allocator() 93 template <class Alloc, class TT, class UU> [all …]
|
/external/llvm-project/llvm/unittests/ADT/ |
D | CoalescingBitVectorTest.cpp | 21 UBitVec::Allocator Alloc; in elementsMatch() local 22 UBitVec Expected(Alloc); in elementsMatch() 40 UBitVec::Allocator Alloc; in TEST() local 41 UBitVec BV1(Alloc); in TEST() 42 UBitVec BV2(Alloc); in TEST() 53 UBitVec::Allocator Alloc; in TEST() local 54 UBitVec BV(Alloc); in TEST() 63 UBitVec::Allocator Alloc; in TEST() local 64 UBitVec BV(Alloc); in TEST() 73 UBitVec::Allocator Alloc; in TEST() local [all …]
|
/external/libcxx/test/std/containers/unord/unord.set/unord.set.swap/ |
D | swap_non_member.pass.cpp | 33 typedef test_allocator<int> Alloc; in main() typedef 34 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 35 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 36 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 61 typedef test_allocator<int> Alloc; in main() typedef 62 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 75 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 76 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 109 typedef test_allocator<int> Alloc; in main() typedef 110 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() [all …]
|
/external/libcxx/test/std/containers/unord/unord.multiset/ |
D | swap_member.pass.cpp | 33 typedef test_allocator<int> Alloc; in main() typedef 34 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 35 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 36 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 61 typedef test_allocator<int> Alloc; in main() typedef 62 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 75 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 76 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 109 typedef test_allocator<int> Alloc; in main() typedef 110 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() [all …]
|
/external/llvm-project/libcxx/test/std/containers/unord/unord.set/ |
D | swap_member.pass.cpp | 32 typedef test_allocator<int> Alloc; in main() typedef 33 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 34 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 35 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 60 typedef test_allocator<int> Alloc; in main() typedef 61 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 74 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 75 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 108 typedef test_allocator<int> Alloc; in main() typedef 109 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() [all …]
|
/external/llvm-project/libcxx/test/std/containers/unord/unord.set/unord.set.swap/ |
D | swap_non_member.pass.cpp | 32 typedef test_allocator<int> Alloc; in main() typedef 33 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 34 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 35 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 60 typedef test_allocator<int> Alloc; in main() typedef 61 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() 74 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 75 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 108 typedef test_allocator<int> Alloc; in main() typedef 109 typedef std::unordered_set<int, Hash, Compare, Alloc> C; in main() [all …]
|
/external/llvm-project/libcxx/test/std/containers/unord/unord.multiset/unord.multiset.swap/ |
D | swap_non_member.pass.cpp | 32 typedef test_allocator<int> Alloc; in main() typedef 33 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 34 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 35 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 60 typedef test_allocator<int> Alloc; in main() typedef 61 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 74 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 75 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 108 typedef test_allocator<int> Alloc; in main() typedef 109 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() [all …]
|
/external/llvm-project/libcxx/test/std/containers/unord/unord.multiset/ |
D | swap_member.pass.cpp | 32 typedef test_allocator<int> Alloc; in main() typedef 33 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 34 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 35 C c2(0, Hash(2), Compare(2), Alloc(1, 2)); in main() 60 typedef test_allocator<int> Alloc; in main() typedef 61 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() 74 C c1(0, Hash(1), Compare(1), Alloc(1, 1)); in main() 75 C c2(std::begin(a2), std::end(a2), 0, Hash(2), Compare(2), Alloc(1, 2)); in main() 108 typedef test_allocator<int> Alloc; in main() typedef 109 typedef std::unordered_multiset<int, Hash, Compare, Alloc> C; in main() [all …]
|