Home
last modified time | relevance | path

Searched refs:memory (Results 1 – 25 of 283) sorted by relevance

12345678910>>...12

/system/core/libunwindstack/tests/
DMemoryTest.cpp32 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
59 memory.SetMemory(100, name.c_str(), name.size() + 1); in TEST()
62 ASSERT_TRUE(memory.ReadString(100, &dst_name, 100)); in TEST()
65 ASSERT_TRUE(memory.ReadString(107, &dst_name, 100)); in TEST()
69 ASSERT_TRUE(memory.ReadString(107, &dst_name, 10)); in TEST()
72 ASSERT_FALSE(memory.ReadString(107, &dst_name, 9)); in TEST()
[all …]
DDexFileTest.cpp109 MemoryFake memory; in TEST() local
111 memory.SetMemory(0x1000, kDexData, 10); in TEST()
113 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "", sizeof(kDexData)) == nullptr); in TEST()
117 MemoryFake memory; in TEST() local
119 memory.SetMemory(0x1000, kDexData, sizeof(kDexData) - 2); in TEST()
121 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "", sizeof(kDexData)) == nullptr); in TEST()
125 MemoryFake memory; in TEST() local
127 memory.SetMemory(0x1000, kDexData, sizeof(kDexData)); in TEST()
129 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "", sizeof(kDexData)) != nullptr); in TEST()
133 MemoryFake memory; in TEST() local
[all …]
DMemoryOfflineTest.cpp37 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()
DMapInfoCreateMemoryTest.cpp94 std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); in TEST_F() local
95 ASSERT_TRUE(memory.get() == nullptr); in TEST_F()
98 memory.reset(info.CreateMemory(process_memory_)); in TEST_F()
99 ASSERT_TRUE(memory.get() == nullptr); in TEST_F()
103 memory.reset(info.CreateMemory(process_memory_)); in TEST_F()
104 ASSERT_TRUE(memory.get() != nullptr); in TEST_F()
113 std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); in TEST_F() local
114 ASSERT_TRUE(memory.get() != nullptr); in TEST_F()
121 ASSERT_TRUE(memory->ReadFully(0, buffer.data(), 1024)); in TEST_F()
128 ASSERT_FALSE(memory->ReadFully(1024, buffer.data(), 1)); in TEST_F()
[all …]
DElfFake.h51 ElfFake(Memory* memory) : Elf(memory) { valid_ = true; } in ElfFake() argument
68 ElfInterfaceFake(Memory* memory) : ElfInterface(memory) {} in ElfInterfaceFake() argument
124 ElfInterface32Fake(Memory* memory) : ElfInterface32(memory) {} in ElfInterface32Fake() argument
135 ElfInterface64Fake(Memory* memory) : ElfInterface64(memory) {} in ElfInterface64Fake() argument
146 ElfInterfaceArmFake(Memory* memory) : ElfInterfaceArm(memory) {} in ElfInterfaceArmFake() argument
DMemoryRangesTest.cpp31 MemoryFake* memory = new MemoryFake; in SetUp() local
32 process_memory_.reset(memory); in SetUp()
33 memory->SetMemoryBlock(1000, 5000, 0x15); in SetUp()
34 memory->SetMemoryBlock(6000, 12000, 0x26); in SetUp()
35 memory->SetMemoryBlock(14000, 20000, 0x37); in SetUp()
36 memory->SetMemoryBlock(20000, 22000, 0x48); in SetUp()
DMemoryFake.cpp37 void MemoryFake::SetMemory(uint64_t addr, const void* memory, size_t length) { in SetMemory() argument
38 const uint8_t* src = reinterpret_cast<const uint8_t*>(memory); in SetMemory()
49 size_t MemoryFake::Read(uint64_t addr, void* memory, size_t size) { in Read() argument
50 uint8_t* dst = reinterpret_cast<uint8_t*>(memory); in Read()
DDwarfDebugFrameTest.cpp51 static void SetCie32(MemoryFake* memory, uint64_t offset, uint32_t length, in SetCie32() argument
53 memory->SetData32(offset, length); in SetCie32()
56 memory->SetData32(offset, 0xffffffff); in SetCie32()
58 memory->SetMemory(offset, data); in SetCie32()
61 static void SetCie64(MemoryFake* memory, uint64_t offset, uint64_t length, in SetCie64() argument
63 memory->SetData32(offset, 0xffffffff); in SetCie64()
65 memory->SetData64(offset, length); in SetCie64()
68 memory->SetData64(offset, 0xffffffffffffffffUL); in SetCie64()
70 memory->SetMemory(offset, data); in SetCie64()
73 static void SetFde32(MemoryFake* memory, uint64_t offset, uint32_t length, uint64_t cie_offset, in SetFde32() argument
[all …]
/system/core/libunwindstack/tests/fuzz/
DUnwinderComponentCreator.cpp142 void WriteDescriptor32(MemoryFake* memory, uint64_t addr, uint32_t entry) { in WriteDescriptor32() argument
145 memory->SetData32(addr, 1); in WriteDescriptor32()
147 memory->SetData32(addr + 4, 0); in WriteDescriptor32()
149 memory->SetData32(addr + 8, 0); in WriteDescriptor32()
151 memory->SetData32(addr + 12, entry); in WriteDescriptor32()
154 void WriteDescriptor64(MemoryFake* memory, uint64_t addr, uint64_t entry) { in WriteDescriptor64() argument
157 memory->SetData32(addr, 1); in WriteDescriptor64()
159 memory->SetData32(addr + 4, 0); in WriteDescriptor64()
161 memory->SetData64(addr + 8, 0); in WriteDescriptor64()
163 memory->SetData64(addr + 16, entry); in WriteDescriptor64()
[all …]
/system/libhidl/transport/allocator/1.0/vts/functional/
DVtsHidlAllocatorV1_0TargetTest.cpp30 using ::android::hidl::memory::V1_0::IMemory;
53 sp<IMemory> memory; in expectAllocateSuccess() local
58 memory = mapMemory(mem); in expectAllocateSuccess()
60 EXPECT_NE(nullptr, memory.get()); in expectAllocateSuccess()
61 EXPECT_EQ(memory->getSize(), size) in expectAllocateSuccess()
62 << "Allocated " << size << " but got IMemory with size " << memory->getSize(); in expectAllocateSuccess()
63 return memory; in expectAllocateSuccess()
80 for (const sp<IMemory>& memory : memories) { in expectBatchAllocateSuccess() local
81 EXPECT_NE(nullptr, memory.get()); in expectBatchAllocateSuccess()
82 EXPECT_EQ(memory->getSize(), size) in expectBatchAllocateSuccess()
[all …]
/system/core/libunwindstack/
DMapInfo.cpp37 bool MapInfo::InitFileMemoryFromPreviousReadOnlyMap(MemoryFileAtOffset* memory) { in InitFileMemoryFromPreviousReadOnlyMap() argument
45 if (!memory->Init(name, prev_real_map->offset, map_size)) { in InitFileMemoryFromPreviousReadOnlyMap()
50 if (!Elf::GetInfo(memory, &max_size) || max_size < map_size) { in InitFileMemoryFromPreviousReadOnlyMap()
54 if (!memory->Init(name, prev_real_map->offset, max_size)) { in InitFileMemoryFromPreviousReadOnlyMap()
64 std::unique_ptr<MemoryFileAtOffset> memory(new MemoryFileAtOffset); in GetFileMemory() local
66 if (memory->Init(name, 0)) { in GetFileMemory()
67 return memory.release(); in GetFileMemory()
87 if (!memory->Init(name, offset, map_size)) { in GetFileMemory()
93 if (Elf::GetInfo(memory.get(), &max_size)) { in GetFileMemory()
96 if (memory->Init(name, offset, max_size)) { in GetFileMemory()
[all …]
DElf.cpp201 bool Elf::IsValidElf(Memory* memory) { in IsValidElf() argument
202 if (memory == nullptr) { in IsValidElf()
208 if (!memory->ReadFully(0, e_ident, SELFMAG)) { in IsValidElf()
218 bool Elf::GetInfo(Memory* memory, uint64_t* size) { in GetInfo() argument
219 if (!IsValidElf(memory)) { in GetInfo()
225 if (!memory->ReadFully(EI_CLASS, &class_type, 1)) { in GetInfo()
231 ElfInterface32::GetMaxSize(memory, size); in GetInfo()
233 ElfInterface64::GetMaxSize(memory, size); in GetInfo()
256 ElfInterface* Elf::CreateInterfaceFromMemory(Memory* memory) { in CreateInterfaceFromMemory() argument
257 if (!IsValidElf(memory)) { in CreateInterfaceFromMemory()
[all …]
DDexFile.h38 static std::unique_ptr<DexFile> Create(uint64_t dex_file_offset_in_memory, Memory* memory,
58 Memory* memory, const std::string& name,
63 std::vector<uint8_t>&& memory) in DexFileFromMemory() argument
64 : DexFile(art_dex_file), memory_(std::move(memory)) {} in DexFileFromMemory()
DGlobal.cpp31 Global::Global(std::shared_ptr<Memory>& memory) : memory_(memory) {} in Global() argument
32 Global::Global(std::shared_ptr<Memory>& memory, std::vector<std::string>& search_libs) in Global() argument
33 : memory_(memory), search_libs_(search_libs) {} in Global()
/system/libhidl/transport/allocator/1.0/
DIAllocator.hal20 * 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);
/system/libhidl/libhidlmemory/
Dmapping.cpp30 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()
/system/extras/memory_replay/
DAlloc.cpp102 void* memory = malloc(entry.size); in MallocExecute() local
103 MakeAllocationResident(memory, entry.size, pagesize); in MallocExecute()
106 pointers->Add(entry.ptr, memory); in MallocExecute()
114 void* memory = calloc(entry.u.n_elements, entry.size); in CallocExecute() local
115 MakeAllocationResident(memory, entry.u.n_elements * entry.size, pagesize); in CallocExecute()
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
[all …]
/system/libhidl/transport/allocator/1.0/default/
DAshmemAllocator.cpp44 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()
/system/core/libunwindstack/include/unwindstack/
DElf.h53 Elf(Memory* memory) : memory_(memory) {} in Elf() argument
74 ElfInterface* CreateInterfaceFromMemory(Memory* memory);
94 Memory* memory() { return memory_.get(); } in memory() function
100 static bool IsValidElf(Memory* memory);
102 static bool GetInfo(Memory* memory, uint64_t* size);
104 static int64_t GetLoadBias(Memory* memory);
106 static std::string GetBuildID(Memory* memory);
DElfInterface.h52 ElfInterface(Memory* memory) : memory_(memory) {} in ElfInterface() argument
73 Memory* memory() { return memory_; } in memory() function
107 static int64_t GetLoadBias(Memory* memory);
110 static std::string ReadBuildIDFromMemory(Memory* memory);
137 static void GetMaxSizeWithTemplate(Memory* memory, uint64_t* size);
188 ElfInterface32(Memory* memory) : ElfInterface(memory) {} in ElfInterface32() argument
209 static void GetMaxSize(Memory* memory, uint64_t* size) { in GetMaxSize() argument
210 GetMaxSizeWithTemplate<Elf32_Ehdr>(memory, size); in GetMaxSize()
216 ElfInterface64(Memory* memory) : ElfInterface(memory) {} in ElfInterface64() argument
237 static void GetMaxSize(Memory* memory, uint64_t* size) { in GetMaxSize() argument
[all …]
/system/libhidl/transport/memory/token/1.0/
DIMemoryToken.hal16 package android.hidl.memory.token@1.0;
19 * Interface which composes shared memory
23 * The returned instance of memory must always be a reference to the same memory.
26 get() generates (memory mem);
/system/libhidl/
DCleanSpec.mk47 $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/bin/hw/android.hidl.memory@1.0-service)
48 $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/etc/init/android.hidl.memory@1.0-service.rc)
51 $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/lib/hw/android.hidl.memory@1.0-impl.so)
/system/core/libunwindstack/tools/
Dunwind_reg_info.cpp52 void PrintExpression(Memory* memory, uint8_t class_type, uint64_t end, uint64_t length) { in PrintExpression() argument
54 DwarfMemory dwarf_memory(memory); in PrintExpression()
67 void PrintRegInformation(DwarfSection* section, Memory* memory, uint64_t pc, uint8_t class_type, in PrintRegInformation() argument
122 PrintExpression(memory, class_type, loc->values[1], loc->values[0]); in PrintRegInformation()
128 PrintExpression(memory, class_type, loc->values[1], loc->values[0]); in PrintRegInformation()
155 ArmExidx arm(nullptr, interface->memory(), nullptr); in PrintArmRegInformation()
208 PrintRegInformation(section, elf.memory(), pc, elf.class_type(), elf.arch()); in GetInfo()
216 PrintRegInformation(section, elf.memory(), pc, elf.class_type(), elf.arch()); in GetInfo()
228 PrintRegInformation(section, gnu_debugdata_interface->memory(), pc, elf.class_type(), in GetInfo()
238 PrintRegInformation(section, gnu_debugdata_interface->memory(), pc, elf.class_type(), in GetInfo()
/system/libhidl/transport/memory/1.0/default/
DAshmemMemory.cpp23 namespace memory { namespace
27 AshmemMemory::AshmemMemory(const hidl_memory& memory, void* data) in AshmemMemory() argument
28 : mMemory(memory), in AshmemMemory()
DAshmemMapper.h26 namespace memory {
30 using ::android::hidl::memory::V1_0::IMapper;
31 using ::android::hidl::memory::V1_0::IMemory;

12345678910>>...12