/aosp12/system/unwinding/libunwindstack/tests/ |
H A D | MemoryTest.cpp | 32 MemoryFakeAlwaysReadZero memory; in TEST() local 35 ASSERT_TRUE(memory.Read32(0, &data)); in TEST() 40 MemoryFakeAlwaysReadZero memory; in TEST() local 43 ASSERT_TRUE(memory.Read64(0, &data)); in TEST() 57 MemoryFake memory; in TEST() local 69 ASSERT_TRUE(memory.ReadString(107, &dst_name, 10)); in TEST() 78 MemoryFake memory; in TEST() local 81 memory.SetMemory(0, name.c_str(), name.size()); in TEST() 91 memory.SetData8(name.size(), '\0'); in TEST() 92 ASSERT_TRUE(memory.ReadString(0, &dst_name, 100)); in TEST() [all …]
|
H A D | DexFileTest.cpp | 62 MemoryFake memory; in TEST() local 70 MemoryFake memory; in TEST() local 90 MemoryFake memory; in TEST() local 103 MemoryFake memory; in TEST() local 116 MemoryFake memory; in TEST() local 122 MemoryFake memory; in TEST() local 129 MemoryFake memory; in TEST() local 142 MemoryFake memory; in TEST() local 149 memory.Clear(); in TEST() 155 MemoryFake memory; in TEST() local [all …]
|
H A D | MapInfoCreateMemoryTest.cpp | 95 ASSERT_TRUE(memory.get() == nullptr); in TEST_F() 99 ASSERT_TRUE(memory.get() == nullptr); in TEST_F() 104 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 114 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 142 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 152 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 162 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 172 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 184 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() 209 ASSERT_TRUE(memory.get() != nullptr); in TEST_F() [all …]
|
H A D | MemoryOfflineTest.cpp | 37 memory = std::make_unique<MemoryOffline>(); in SetUp() 38 ASSERT_TRUE(memory != nullptr); in SetUp() 40 ASSERT_TRUE(memory->Init(temp_file.path, 0)); in SetUp() 46 std::unique_ptr<MemoryOffline> memory; member in unwindstack::MemoryOfflineTest 51 ASSERT_EQ(0U, memory->Read(offset - 1, &buf, 1)); in TEST_F() 52 ASSERT_EQ(0U, memory->Read(offset + data.size(), &buf, 1)); in TEST_F() 53 ASSERT_EQ(1U, memory->Read(offset, &buf, 1)); in TEST_F() 55 ASSERT_EQ(1U, memory->Read(offset + data.size() - 1, &buf, 1)); in TEST_F() 62 ASSERT_EQ(data.size(), memory->Read(offset, buf.data(), buf.size())); in TEST_F()
|
/aosp12/system/unwinding/libunwindstack/tests/fuzz/ |
H A D | UnwinderComponentCreator.cpp | 188 memory->SetData32(addr, 1); in WriteDescriptor32() 190 memory->SetData32(addr + 4, 0); in WriteDescriptor32() 192 memory->SetData32(addr + 8, 0); in WriteDescriptor32() 200 memory->SetData32(addr, 1); in WriteDescriptor64() 202 memory->SetData32(addr + 4, 0); in WriteDescriptor64() 204 memory->SetData64(addr + 8, 0); in WriteDescriptor64() 213 memory->SetData32(addr, next); in WriteEntry32Pack() 215 memory->SetData32(addr + 4, prev); in WriteEntry32Pack() 226 memory->SetData32(addr, next); in WriteEntry32Pad() 232 memory->SetData32(addr + 12, 0); in WriteEntry32Pad() [all …]
|
/aosp12/system/libhidl/transport/allocator/1.0/vts/functional/ |
H A D | VtsHidlAllocatorV1_0TargetTest.cpp | 44 sp<IMemory> memory; in expectAllocateSuccess() local 49 memory = mapMemory(mem); in expectAllocateSuccess() 54 return memory; in expectAllocateSuccess() 101 EXPECT_OK(memory->read()); in TEST_P() 102 EXPECT_OK(memory->update()); in TEST_P() 103 EXPECT_OK(memory->commit()); in TEST_P() 105 EXPECT_OK(memory->read()); in TEST_P() 106 EXPECT_OK(memory->commit()); in TEST_P() 108 EXPECT_OK(memory->update()); in TEST_P() 109 EXPECT_OK(memory->commit()); in TEST_P() [all …]
|
/aosp12/packages/modules/NeuralNetworks/common/ |
H A D | SharedMemoryAndroid.cpp | 88 maybeMemory = memory; in allocateSharedMemory() 169 size_t getSize(const Memory::Ashmem& memory) { in getSize() argument 170 return memory.size; in getSize() 173 size_t getSize(const Memory::Fd& memory) { in getSize() argument 174 return memory.size; in getSize() 184 return memory.size; in getSize() 194 base::MappedFile::FromFd(memory.fd, memory.offset, memory.size, memory.prot); in map() 279 size_t getSize(const SharedMemory& memory) { in getSize() argument 280 CHECK(memory != nullptr); in getSize() 292 CHECK(memory != nullptr); in isAhwbBlob() [all …]
|
/aosp12/system/unwinding/libunwindstack/ |
H A D | MapInfo.cpp | 67 return memory.release(); in GetFileMemory() 106 return memory.release(); in GetFileMemory() 110 if (memory->Init(name(), 0) && Elf::IsValidElf(memory.get())) { in GetFileMemory() 119 return memory.release(); in GetFileMemory() 125 return memory.release(); in GetFileMemory() 131 return memory.release(); in GetFileMemory() 151 if (memory != nullptr) { in CreateMemory() 152 return memory; in CreateMemory() 175 return memory.release(); in CreateMemory() 237 delete memory; in GetElf() [all …]
|
H A D | Elf.cpp | 205 bool Elf::IsValidElf(Memory* memory) { in IsValidElf() argument 206 if (memory == nullptr) { in IsValidElf() 212 if (!memory->ReadFully(0, e_ident, SELFMAG)) { in IsValidElf() 223 if (!IsValidElf(memory)) { in GetInfo() 235 ElfInterface32::GetMaxSize(memory, size); in GetInfo() 237 ElfInterface64::GetMaxSize(memory, size); in GetInfo() 279 if (!IsValidElf(memory)) { in CreateInterfaceFromMemory() 333 int64_t Elf::GetLoadBias(Memory* memory) { in GetLoadBias() argument 334 if (!IsValidElf(memory)) { in GetLoadBias() 426 std::string Elf::GetBuildID(Memory* memory) { in GetBuildID() argument [all …]
|
/aosp12/hardware/interfaces/neuralnetworks/utils/common/src/ |
H A D | CommonUtils.cpp | 110 auto fd = NN_TRY(nn::dupFd(memory.fd)); in createHidlMemoryFrom() 116 auto fd = NN_TRY(nn::dupFd(memory.fd)); in createHidlMemoryFrom() 126 const auto* ahwb = memory.handle.get(); in createHidlMemoryFrom() 142 return hidl_memory(memory.name, NN_TRY(hidlHandleFromSharedHandle(memory.handle)), memory.size); in createHidlMemoryFrom() 299 if (memory == nullptr) { in createHidlMemoryFromSharedMemory() 311 if (!memory.valid()) { in createSharedMemoryFromHidlMemory() 315 if (memory.name() == "ashmem") { in createSharedMemoryFromHidlMemory() 316 if (memory.handle()->numFds != 1) { in createSharedMemoryFromHidlMemory() 331 if (memory.name() == "mmap_fd") { in createSharedMemoryFromHidlMemory() 354 .name = memory.name(), in createSharedMemoryFromHidlMemory() [all …]
|
/aosp12/hardware/interfaces/soundtrigger/2.1/default/ |
H A D | SoundTriggerHw.cpp | 29 using android::hidl::memory::V1_0::IMemory; 45 sp<IMemory> memory; in memoryAsVector() local 49 memory = mapMemory(m); in memoryAsVector() 50 if (memory != nullptr) { in memoryAsVector() 51 memory->read(); in memoryAsVector() 57 return std::make_pair(false, memory); in memoryAsVector() 67 sp<IMemory> memory; in moveVectorToMemory() local 83 if (memory != 0) { in moveVectorToMemory() 84 memory->update(); in moveVectorToMemory() 86 memory->commit(); in moveVectorToMemory() [all …]
|
/aosp12/system/libhidl/transport/allocator/1.0/ |
H A D | IAllocator.hal | 20 * Interface which allocates the required memory. 25 * Return memory must have instance name corresponding to this type of memory. 27 * @param size Size of memory to allocate in bytes. 29 * @return memory Unmapped memory object. 31 allocate(uint64_t size) generates (bool success, memory mem); 34 * Return memory must have instance name corresponding to this type of memory. 36 * @param size Size of memory to allocate in bytes. 37 * @param count Number of memory instances to allocate. 39 * @return batch Unmapped memory objects. 41 batchAllocate(uint64_t size, uint64_t count) generates (bool success, vec<memory> batch);
|
/aosp12/packages/modules/NeuralNetworks/runtime/ |
H A D | Memory.cpp | 183 RuntimeMemory::RuntimeMemory(SharedMemory memory) : kMemory(std::move(memory)) { in RuntimeMemory() argument 500 CHECK(memory != nullptr); in allocate() 505 return {n, std::move(memory)}; in allocate() 510 if (!memory.has_value()) { in create() 514 auto mapping = map(memory.value()); in create() 533 if (!memory.has_value()) { in create() 540 MemoryFd::MemoryFd(SharedMemory memory) : RuntimeMemory(std::move(memory)) {} in MemoryFd() argument 545 if (!memory.has_value()) { in create() 551 if (isAhwbBlob(memory.value())) { in create() 579 if (!memory.has_value()) { in create() [all …]
|
/aosp12/packages/modules/NeuralNetworks/runtime/test/ |
H A D | TestMemoryDomain.cpp | 236 ANeuralNetworksMemory* memory; in allocateDeviceMemory() local 285 bool isAshmem(const SharedMemory& memory) { in isAshmem() argument 286 return memory != nullptr && std::holds_alternative<Memory::Ashmem>(memory->handle); in isAshmem() 315 const auto& memory = m->getMemory(); in TEST_P() local 316 EXPECT_TRUE(validate(memory).ok()); in TEST_P() 318 EXPECT_TRUE(isAshmem(memory)); in TEST_P() 320 EXPECT_TRUE(isAhwbBlob(memory)); in TEST_P() 378 EXPECT_TRUE(validate(memory).ok()); in TEST_P() 380 EXPECT_TRUE(isAshmem(memory)); in TEST_P() 401 EXPECT_TRUE(validate(memory).ok()); in TEST_P() [all …]
|
H A D | TestValidation.cpp | 245 for (auto* memory : mMemories) ANeuralNetworksMemory_free(memory); in TearDown() local 615 ANeuralNetworksMemory* memory; in TEST_F() local 677 ANeuralNetworksMemory* memory; in TEST_F() local 708 ANeuralNetworksMemory* memory; in TEST_F() local 1678 ANeuralNetworksMemory* memory; in TEST_F() local 1778 ANeuralNetworksMemory* memory; in TEST_F() local 1853 ANeuralNetworksMemory* memory; in TEST_F() local 1959 ANeuralNetworksMemory* memory; in TEST_F() local 2098 ANeuralNetworksMemory* memory; in TEST_F() local 2157 ANeuralNetworksMemory* memory; in TEST_F() local [all …]
|
/aosp12/system/extras/memory_replay/ |
H A D | Alloc.cpp | 102 void* memory = malloc(entry.size); in MallocExecute() local 103 MakeAllocationResident(memory, entry.size, pagesize); in MallocExecute() 106 pointers->Add(entry.ptr, memory); in MallocExecute() 118 pointers->Add(entry.ptr, memory); in CallocExecute() 131 void* memory = realloc(old_memory, entry.size); in ReallocExecute() local 132 MakeAllocationResident(memory, entry.size, pagesize); in ReallocExecute() 135 pointers->Add(entry.ptr, memory); in ReallocExecute() 143 void* memory = memalign(entry.u.align, entry.size); in MemalignExecute() local 147 pointers->Add(entry.ptr, memory); in MemalignExecute() 157 void* memory = pointers->Remove(entry.ptr); in FreeExecute() local [all …]
|
/aosp12/hardware/interfaces/memtrack/1.0/ |
H A D | IMemtrack.hal | 21 * device-specific memory usage. 22 * The primary goal is to be able to track memory that is not 23 * trackable in any other way, for example texture memory that is allocated by 25 * A secondary goal is to be able to categorize memory used by a process into 26 * GL, graphics, etc. All memory sizes must be in real memory usage, 34 * getMemory() populates MemtrackRecord vector with the sizes of memory 35 * plus associated flags for that memory. 40 * A process collecting memory statistics will call getMemory for each 41 * combination of pid and memory type. For each memory type that it 60 * @param pid process for which memory information is requested [all …]
|
H A D | types.hal | 21 * Flags to differentiate memory that can already be accounted for in 24 * In general, memory mapped in to a userspace process is accounted unless 29 * Flags to differentiate memory shared across multiple processes vs. memory 31 * If SHARED_PSS flags is used, the memory must be divided by the number of 34 * If none are set, record is assumed to count shared + private memory. 37 * Flags to differentiate memory taken from the kernel's allocation pool vs. 38 * memory that is dedicated to non-kernel allocations, for example a carveout 40 * If none are set, record is assumed to count system + dedicated memory. 45 * If none are set, record is assumed to count secure + nonsecure memory. 59 /** Tags which define the usage of the memory buffers. */ [all …]
|
/aosp12/hardware/interfaces/tests/memory/1.0/default/ |
H A D | MemoryTest.cpp | 28 using android::hidl::memory::V1_0::IMemory; 33 namespace memory { namespace 44 sp<IMemory> memory = mapMemory(memory_in); in fillMemory() local 46 if (memory == nullptr) { in fillMemory() 51 uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(memory->getPointer())); in fillMemory() 53 memory->update(); in fillMemory() 55 for (size_t i = 0; i < memory->getSize(); i++) { in fillMemory() 59 memory->commit(); in fillMemory()
|
/aosp12/system/libhidl/libhidlmemory/ |
H A D | mapping.cpp | 30 using android::hidl::memory::V1_0::IMemory; 31 using android::hidl::memory::V1_0::IMapper; 53 sp<IMemory> mapMemory(const hidl_memory& memory) { in mapMemory() argument 55 sp<IMapper> mapper = getMapperService(memory.name()); in mapMemory() 58 LOG(ERROR) << "Could not fetch mapper for " << memory.name() << " shared memory"; in mapMemory() 70 if (memory.size() > SIZE_MAX) { in mapMemory() 71 LOG(ERROR) << "Cannot map " << memory.size() << " bytes of memory because it is too large."; in mapMemory() 76 Return<sp<IMemory>> ret = mapper->mapMemory(memory); in mapMemory()
|
/aosp12/system/libhidl/transport/allocator/1.0/default/ |
H A D | AshmemAllocator.cpp | 44 static void cleanup(hidl_memory&& memory) { in cleanup() argument 45 if (memory.handle() == nullptr) { in cleanup() 49 native_handle_close(const_cast<native_handle_t *>(memory.handle())); in cleanup() 50 native_handle_delete(const_cast<native_handle_t *>(memory.handle())); in cleanup() 54 hidl_memory memory = allocateOne(size); in allocate() local 55 _hidl_cb(memory.handle() != nullptr /* success */, memory); in allocate() 56 cleanup(std::move(memory)); in allocate()
|
/aosp12/hardware/interfaces/neuralnetworks/utils/common/test/ |
H A D | ResilientBufferTest.cpp | 118 const nn::SharedMemory memory = std::make_shared<const nn::Memory>(); in TEST() local 119 const auto result = buffer->copyTo(memory); in TEST() 132 const nn::SharedMemory memory = std::make_shared<const nn::Memory>(); in TEST() local 133 const auto result = buffer->copyTo(memory); in TEST() 147 const nn::SharedMemory memory = std::make_shared<const nn::Memory>(); in TEST() local 148 const auto result = buffer->copyTo(memory); in TEST() 165 const auto result = buffer->copyTo(memory); in TEST() 179 const auto result = buffer->copyFrom(memory, {}); in TEST() 193 const auto result = buffer->copyFrom(memory, {}); in TEST() 208 const auto result = buffer->copyFrom(memory, {}); in TEST() [all …]
|
/aosp12/art/test/949-in-memory-transform/ |
H A D | Android.bp | 3 // Build rules for ART run-test `949-in-memory-transform`. 16 name: "art-run-test-949-in-memory-transform", 21 ":art-run-test-949-in-memory-transform-expected-stdout", 22 ":art-run-test-949-in-memory-transform-expected-stderr", 28 name: "art-run-test-949-in-memory-transform-expected-stdout", 29 out: ["art-run-test-949-in-memory-transform-expected-stdout.txt"], 36 name: "art-run-test-949-in-memory-transform-expected-stderr", 37 out: ["art-run-test-949-in-memory-transform-expected-stderr.txt"],
|
/aosp12/art/test/061-out-of-memory/ |
H A D | Android.bp | 3 // Build rules for ART run-test `061-out-of-memory`. 16 name: "art-run-test-061-out-of-memory", 21 ":art-run-test-061-out-of-memory-expected-stdout", 22 ":art-run-test-061-out-of-memory-expected-stderr", 28 name: "art-run-test-061-out-of-memory-expected-stdout", 29 out: ["art-run-test-061-out-of-memory-expected-stdout.txt"], 36 name: "art-run-test-061-out-of-memory-expected-stderr", 37 out: ["art-run-test-061-out-of-memory-expected-stderr.txt"],
|
/aosp12/hardware/interfaces/tests/memory/2.0/ |
H A D | IMemoryInterface.hal | 1 package android.hardware.tests.memory@2.0; 4 // Flips all the bits in the given memory buffer. 5 bitwiseNot(memory mem); 7 getTestMem() generates(memory mem); 8 // Given two memory regions of the same size, returns two memory fields of
|