Home
last modified time | relevance | path

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

12345678910

/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)); in TEST()
65 ASSERT_TRUE(memory.ReadString(107, &dst_name)); 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.cpp76 MemoryFake memory; in TEST() local
78 memory.SetMemory(0x1000, kDexData, 10); in TEST()
80 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "") == nullptr); in TEST()
84 MemoryFake memory; in TEST() local
86 memory.SetMemory(0x1000, kDexData, sizeof(kDexData) - 2); in TEST()
88 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "") == nullptr); in TEST()
92 MemoryFake memory; in TEST() local
94 memory.SetMemory(0x1000, kDexData, sizeof(kDexData)); in TEST()
96 EXPECT_TRUE(DexFileFromMemory::Create(0x1000, &memory, "") != nullptr); in TEST()
107 MemoryFake memory; in TEST() local
[all …]
DMemoryOfflineTest.cpp36 memory = std::make_unique<MemoryOffline>(); in SetUp()
37 ASSERT_TRUE(memory != nullptr); in SetUp()
39 ASSERT_TRUE(memory->Init(temp_file.path, 0)); in SetUp()
45 std::unique_ptr<MemoryOffline> memory; member in unwindstack::MemoryOfflineTest
50 ASSERT_EQ(0U, memory->Read(offset - 1, &buf, 1)); in TEST_F()
51 ASSERT_EQ(0U, memory->Read(offset + data.size(), &buf, 1)); in TEST_F()
52 ASSERT_EQ(1U, memory->Read(offset, &buf, 1)); in TEST_F()
54 ASSERT_EQ(1U, memory->Read(offset + data.size() - 1, &buf, 1)); in TEST_F()
61 ASSERT_EQ(data.size(), memory->Read(offset, buf.data(), buf.size())); in TEST_F()
DMapInfoCreateMemoryTest.cpp100 std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); in TEST_F() local
101 ASSERT_TRUE(memory.get() == nullptr); in TEST_F()
104 memory.reset(info.CreateMemory(process_memory_)); in TEST_F()
105 ASSERT_TRUE(memory.get() == nullptr); in TEST_F()
109 memory.reset(info.CreateMemory(process_memory_)); in TEST_F()
110 ASSERT_TRUE(memory.get() != nullptr); in TEST_F()
119 std::unique_ptr<Memory> memory(info.CreateMemory(process_memory_)); in TEST_F() local
120 ASSERT_TRUE(memory.get() != nullptr); in TEST_F()
127 ASSERT_TRUE(memory->ReadFully(0, buffer.data(), 1024)); in TEST_F()
134 ASSERT_FALSE(memory->ReadFully(1024, buffer.data(), 1)); in TEST_F()
[all …]
DElfFake.h51 ElfFake(Memory* memory) : Elf(memory) { valid_ = true; } in ElfFake() argument
66 ElfInterfaceFake(Memory* memory) : ElfInterface(memory) {} in ElfInterfaceFake() argument
111 ElfInterface32Fake(Memory* memory) : ElfInterface32(memory) {} in ElfInterface32Fake() argument
122 ElfInterface64Fake(Memory* memory) : ElfInterface64(memory) {} in ElfInterface64Fake() argument
133 ElfInterfaceArmFake(Memory* memory) : ElfInterfaceArm(memory) {} in ElfInterfaceArmFake() argument
DMemoryRangesTest.cpp32 MemoryFake* memory = new MemoryFake; in SetUp() local
33 process_memory_.reset(memory); in SetUp()
34 memory->SetMemoryBlock(1000, 5000, 0x15); in SetUp()
35 memory->SetMemoryBlock(6000, 12000, 0x26); in SetUp()
36 memory->SetMemoryBlock(14000, 20000, 0x37); in SetUp()
37 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()
/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.cpp34 bool MapInfo::InitFileMemoryFromPreviousReadOnlyMap(MemoryFileAtOffset* memory) { in InitFileMemoryFromPreviousReadOnlyMap() argument
42 if (!memory->Init(name, prev_map->offset, map_size)) { in InitFileMemoryFromPreviousReadOnlyMap()
47 if (!Elf::GetInfo(memory, &max_size) || max_size < map_size) { in InitFileMemoryFromPreviousReadOnlyMap()
51 if (!memory->Init(name, prev_map->offset, max_size)) { in InitFileMemoryFromPreviousReadOnlyMap()
61 std::unique_ptr<MemoryFileAtOffset> memory(new MemoryFileAtOffset); in GetFileMemory() local
63 if (memory->Init(name, 0)) { in GetFileMemory()
64 return memory.release(); in GetFileMemory()
84 if (!memory->Init(name, offset, map_size)) { in GetFileMemory()
90 if (Elf::GetInfo(memory.get(), &max_size)) { in GetFileMemory()
93 if (memory->Init(name, offset, max_size)) { in GetFileMemory()
[all …]
DElf.cpp192 bool Elf::IsValidElf(Memory* memory) { in IsValidElf() argument
193 if (memory == nullptr) { in IsValidElf()
199 if (!memory->ReadFully(0, e_ident, SELFMAG)) { in IsValidElf()
209 bool Elf::GetInfo(Memory* memory, uint64_t* size) { in GetInfo() argument
210 if (!IsValidElf(memory)) { in GetInfo()
216 if (!memory->ReadFully(EI_CLASS, &class_type, 1)) { in GetInfo()
222 ElfInterface32::GetMaxSize(memory, size); in GetInfo()
224 ElfInterface64::GetMaxSize(memory, size); in GetInfo()
247 ElfInterface* Elf::CreateInterfaceFromMemory(Memory* memory) { in CreateInterfaceFromMemory() argument
248 if (!IsValidElf(memory)) { in CreateInterfaceFromMemory()
[all …]
/system/extras/memory_replay/tests/
DActionTest.cpp25 uint8_t memory[Action::MaxActionSize()]; in TEST() local
27 Action* action = Action::CreateAction(0x1234, "malloc", line, memory); in TEST()
40 uint8_t memory[128]; in TEST() local
42 Action* action = Action::CreateAction(0x1234, "malloc", line, memory); in TEST()
47 uint8_t memory[128]; in TEST() local
49 Action* action = Action::CreateAction(0x1234, "free", line, memory); in TEST()
60 uint8_t memory[128]; in TEST() local
62 Action* action = Action::CreateAction(0x1234, "calloc", line, memory); in TEST()
75 uint8_t memory[128]; in TEST() local
77 Action* action = Action::CreateAction(0, "free", line, memory); in TEST()
[all …]
/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/
DAction.cpp67 void* memory = malloc(size_); in Execute() local
70 memset(memory, 1, size_); in Execute()
71 pointers->Add(key_pointer_, memory); in Execute()
87 void* memory = calloc(n_elements_, size_); in Execute() local
90 memset(memory, 0, n_elements_ * size_); in Execute()
91 pointers->Add(key_pointer_, memory); in Execute()
117 void* memory = realloc(old_memory, size_); in Execute() local
120 memset(memory, 1, size_); in Execute()
121 pointers->Add(key_pointer_, memory); in Execute()
140 void* memory = memalign(align_, size_); in Execute() 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/libhidl/libhidlcache/
DAndroid.bp31 "android.hidl.memory@1.0",
32 "android.hidl.memory.block@1.0",
33 "android.hidl.memory.token@1.0",
38 "android.hidl.memory@1.0",
39 "android.hidl.memory.block@1.0",
40 "android.hidl.memory.token@1.0",
56 "android.hidl.memory@1.0",
57 "android.hidl.memory.block@1.0",
58 "android.hidl.memory.token@1.0",
Dmapping.cpp29 using android::hidl::memory::block::V1_0::MemoryBlock;
30 using android::hidl::memory::token::V1_0::IMemoryToken;
31 using android::hidl::memory::V1_0::IMemory;
36 sp<IMemory> mapMemory(const ::android::hidl::memory::block::V1_0::MemoryBlock& block) { in mapMemory()
41 sp<RefBase> lockMemoryCache(const sp<::android::hidl::memory::token::V1_0::IMemoryToken> key) { in lockMemoryCache()
DHidlMemoryCache.h30 using IMemoryToken = ::android::hidl::memory::token::V1_0::IMemoryToken;
43 : public virtual HidlCache<sp<::android::hidl::memory::token::V1_0::IMemoryToken>,
44 ::android::hidl::memory::V1_0::IMemory, IMemoryTokenCompare> {
45 using IMemoryToken = ::android::hidl::memory::token::V1_0::IMemoryToken;
46 using IMemory = ::android::hidl::memory::V1_0::IMemory;
47 using MemoryBlock = ::android::hidl::memory::block::V1_0::MemoryBlock;
/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 uint64_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
101 static uint64_t GetLoadBias(Memory* memory);
104 static std::string ReadBuildIDFromMemory(Memory* memory);
131 static void GetMaxSizeWithTemplate(Memory* memory, uint64_t* size);
175 ElfInterface32(Memory* memory) : ElfInterface(memory) {} in ElfInterface32() argument
198 static void GetMaxSize(Memory* memory, uint64_t* size) { in GetMaxSize() argument
199 GetMaxSizeWithTemplate<Elf32_Ehdr>(memory, size); in GetMaxSize()
205 ElfInterface64(Memory* memory) : ElfInterface(memory) {} in ElfInterface64() argument
228 static void GetMaxSize(Memory* memory, uint64_t* size) { in GetMaxSize() argument
[all …]
/system/core/libunwindstack/tools/
Dunwind_reg_info.cpp51 void PrintExpression(Memory* memory, uint8_t class_type, uint64_t end, uint64_t length) { in PrintExpression() argument
53 DwarfMemory dwarf_memory(memory); in PrintExpression()
66 void PrintRegInformation(DwarfSection* section, Memory* memory, uint64_t pc, uint8_t class_type) { in PrintRegInformation() argument
120 PrintExpression(memory, class_type, loc->values[1], loc->values[0]); in PrintRegInformation()
126 PrintExpression(memory, class_type, loc->values[1], loc->values[0]); in PrintRegInformation()
148 ArmExidx arm(nullptr, interface->memory(), nullptr); in PrintArmRegInformation()
168 MemoryFileAtOffset* memory = new MemoryFileAtOffset; in GetInfo() local
169 if (!memory->Init(file, 0)) { in GetInfo()
175 Elf elf(memory); in GetInfo()
208 PrintRegInformation(section, memory, pc, elf.class_type()); in GetInfo()
[all …]
/system/libhidl/libhidlcache/include/hidlcache/
DMemoryDealer.h58 using IMemory = ::android::hidl::memory::V1_0::IMemory;
59 using IMemoryToken = ::android::hidl::memory::token::V1_0::IMemoryToken;
60 using MemoryBlock = ::android::hidl::memory::block::V1_0::MemoryBlock;
65 static sp<HidlMemoryDealer> getInstance(const hidl_memory& memory);
72 HidlMemoryDealer(sp<IMemory> heap, const hidl_memory& memory);
Dmapping.h35 sp<::android::hidl::memory::V1_0::IMemory> mapMemory(
36 const ::android::hidl::memory::block::V1_0::MemoryBlock& block);
50 sp<RefBase> lockMemoryCache(const sp<::android::hidl::memory::token::V1_0::IMemoryToken> key);
/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)

12345678910