Implement utils::memory_map_fd (partial)

Improve JIT profiling dump format (data + name, mmap)
Improve objdump interception util (better speed, fix bugs)
Rename spu_ubertrampoline to __ub+number
This commit is contained in:
Nekotekina 2022-01-26 04:48:20 +03:00
parent ffe00e8619
commit dba2baba9c
5 changed files with 139 additions and 68 deletions

View file

@ -296,6 +296,23 @@ namespace utils
#endif
}
void* memory_map_fd(native_handle fd, usz size, protection prot)
{
#ifdef _WIN32
// TODO
return nullptr;
#else
const auto result = ::mmap(nullptr, size, +prot, MAP_SHARED, fd, 0);
if (result == reinterpret_cast<void*>(uptr{umax}))
{
[[unlikely]] return nullptr;
}
return result;
#endif
}
shm::shm(u32 size, u32 flags)
: m_flags(flags)
, m_size(utils::align(size, 0x10000))