Skip to content

Commit

Permalink
Profiler: Fixes zeroing of allocated slots.
Browse files Browse the repository at this point in the history
Was accidentally zeroing size of ThreadStatsHeader instead of
ThreadStats. So 64 bytes instead of 48, which would have overrunned a
slot.
  • Loading branch information
Sonicadvance1 committed Feb 13, 2025
1 parent 6651f9e commit f25cdcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Common/Profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ FEXCore::Profiler::ThreadStats* StatAllocBase::AllocateSlot(uint32_t TID) {
--RemainingSlots;

// Slot might be reused, just zero it now.
memset(AllocatedSlot, 0, sizeof(FEXCore::Profiler::ThreadStatsHeader));
memset(AllocatedSlot, 0, sizeof(*AllocatedSlot));

// TID != 0 means slot is allocated.
AllocatedSlot->TID.store(TID, std::memory_order_relaxed);
Expand Down

0 comments on commit f25cdcd

Please sign in to comment.