mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 13:00:15 +02:00
SHMStats: Adds ThreadStats size to header
Reused the padding area so the header format doesn't change. If it is non-zero then it should be used by the tool.
This commit is contained in:
2 files changed
+3
-2
No files matched your search
@@ -44,7 +44,7 @@ enum class AppType : uint8_t {
|
||||
struct ThreadStatsHeader {
|
||||
uint8_t Version;
|
||||
AppType app_type;
|
||||
uint8_t _pad[2];
|
||||
uint16_t ThreadStatsSize;
|
||||
char fex_version[48];
|
||||
std::atomic<uint32_t> Head;
|
||||
std::atomic<uint32_t> Size;
|
||||
|
||||
@@ -13,10 +13,11 @@ void StatAllocBase::SaveHeader(FEXCore::SHMStats::AppType AppType) {
|
||||
Head = reinterpret_cast<FEXCore::SHMStats::ThreadStatsHeader*>(Base);
|
||||
Head->Size.store(CurrentSize, std::memory_order_relaxed);
|
||||
Head->Version = FEXCore::SHMStats::STATS_VERSION;
|
||||
Head->app_type = AppType;
|
||||
Head->ThreadStatsSize = sizeof(FEXCore::SHMStats::ThreadStats);
|
||||
|
||||
std::string_view GitString = GIT_DESCRIBE_STRING;
|
||||
strncpy(Head->fex_version, GitString.data(), std::min(GitString.size(), sizeof(Head->fex_version)));
|
||||
Head->app_type = AppType;
|
||||
|
||||
Stats = reinterpret_cast<FEXCore::SHMStats::ThreadStats*>(reinterpret_cast<uint64_t>(Base) + sizeof(FEXCore::SHMStats::ThreadStatsHeader));
|
||||
|
||||
|
||||
Reference in new issue
Block a user