本文整理汇总了C++中IsMyAddress函数的典型用法代码示例。如果您正苦于以下问题:C++ IsMyAddress函数的具体用法?C++ IsMyAddress怎么用?C++ IsMyAddress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsMyAddress函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool MemoryBlockLE::Read128(const u64 addr, u128* value)
{
if(!IsMyAddress(addr)) return false;
*value = *(u128*)GetMem(FixAddr(addr));
return true;
}
示例2: SetMemFromAddr
bool MemoryBlock::SetMemFromAddr(void* src, const u64 addr, const u32 size)
{
if(!IsMyAddress(addr) || FixAddr(addr) + size > GetSize()) return false;
// mem cpy(GetMem(FixAddr(addr)), src, size);
return Memory.CopyFromReal((u32)addr, src, size);
}
示例3: GetMemFromAddr
bool MemoryBlock::GetMemFromAddr(void* dst, const u64 addr, const u32 size)
{
if(!IsMyAddress(addr) || FixAddr(addr) + size > GetSize()) return false;
// mem cpy(dst, GetMem(FixAddr(addr)), size);
return Memory.CopyToReal(dst, (u32)addr, size);
}
示例4: SetMemFromAddr
bool MemoryBlock::SetMemFromAddr(void* src, const u64 addr, const u32 size)
{
if(!IsMyAddress(addr) || FixAddr(addr) + size > GetSize()) return false;
memcpy(GetMem(FixAddr(addr)), src, size);
return true;
}
示例5:
bool MemoryBlock::Write8(const u64 addr, const u8 value)
{
if(!IsMyAddress(addr) || IsLocked(addr)) return false;
//std::atomic_store((std::atomic<u8>*)GetMem(FixAddr(addr)), value);
FastWrite<u8>(FixAddr(addr), value);
return true;
}
示例6: GetMemFFromAddr
bool MemoryBlock::GetMemFFromAddr(void* dst, const u64 addr)
{
if(!IsMyAddress(addr)) return false;
dst = GetMem(FixAddr(addr));
return true;
}
示例7:
bool MemoryBlock::Read128(const u64 addr, u128* value)
{
if(!IsMyAddress(addr))
{
*value = u128::From32(0);
return false;
}
*value = FastRead128(FixAddr(addr));
return true;
}
示例8: Map
u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr)
{
if(addr)
{
if(!IsInMyRange(addr, size) && (IsMyAddress(addr) || IsMyAddress(addr + size - 1)))
return 0;
m_mapped_memory.emplace_back(addr, realaddr, size);
return addr;
}
else
{
for(u64 addr = GetStartAddr(); addr <= GetEndAddr() - GetReservedAmount() - size;)
{
bool is_good_addr = true;
// check if address is already mapped
for(u32 i=0; i<m_mapped_memory.size(); ++i)
{
if((addr >= m_mapped_memory[i].addr && addr < m_mapped_memory[i].addr + m_mapped_memory[i].size) ||
(m_mapped_memory[i].addr >= addr && m_mapped_memory[i].addr < addr + size))
{
is_good_addr = false;
addr = m_mapped_memory[i].addr + m_mapped_memory[i].size;
break;
}
}
if(!is_good_addr) continue;
m_mapped_memory.emplace_back(addr, realaddr, size);
return addr;
}
return 0;
}
}
示例9: GetMemFromAddr
u8* MemoryBlock::GetMemFromAddr(const u64 addr)
{
if(!IsMyAddress(addr) || IsNULL()) return nullptr;
return GetMem(FixAddr(addr));
}