fix: breakpad use miniz
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
This commit is contained in:
72
third_party/tracy/server/TracyThreadCompress.cpp
vendored
Normal file
72
third_party/tracy/server/TracyThreadCompress.cpp
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
#include <limits>
|
||||
|
||||
#include "TracyFileRead.hpp"
|
||||
#include "TracyFileWrite.hpp"
|
||||
#include "TracyThreadCompress.hpp"
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
ThreadCompress::ThreadCompress()
|
||||
: m_threadLast( std::numeric_limits<uint64_t>::max(), 0 )
|
||||
{
|
||||
}
|
||||
|
||||
void ThreadCompress::InitZero()
|
||||
{
|
||||
assert( m_threadExpand.empty() );
|
||||
m_threadExpand.push_back( 0 );
|
||||
}
|
||||
|
||||
void ThreadCompress::Load( FileRead& f )
|
||||
{
|
||||
assert( m_threadExpand.empty() );
|
||||
assert( m_threadMap.empty() );
|
||||
|
||||
uint64_t sz;
|
||||
f.Read( sz );
|
||||
if( sz != 0 )
|
||||
{
|
||||
m_threadExpand.reserve_and_use( sz );
|
||||
f.Read( m_threadExpand.data(), sizeof( uint64_t ) * sz );
|
||||
m_threadMap.reserve( sz );
|
||||
for( size_t i=0; i<sz; i++ )
|
||||
{
|
||||
m_threadMap.emplace( m_threadExpand[i], i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ThreadCompress::Save( FileWrite& f ) const
|
||||
{
|
||||
uint64_t sz = m_threadExpand.size();
|
||||
f.Write( &sz, sizeof( sz ) );
|
||||
if( sz != 0 ) f.Write( m_threadExpand.data(), sz * sizeof( uint64_t ) );
|
||||
}
|
||||
|
||||
uint16_t ThreadCompress::CompressThreadReal( uint64_t thread )
|
||||
{
|
||||
auto it = m_threadMap.find( thread );
|
||||
if( it != m_threadMap.end() )
|
||||
{
|
||||
m_threadLast.first = thread;
|
||||
m_threadLast.second = it->second;
|
||||
return it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CompressThreadNew( thread );
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t ThreadCompress::CompressThreadNew( uint64_t thread )
|
||||
{
|
||||
auto sz = m_threadExpand.size();
|
||||
m_threadExpand.push_back( thread );
|
||||
m_threadMap.emplace( thread, sz );
|
||||
m_threadLast.first = thread;
|
||||
m_threadLast.second = sz;
|
||||
return sz;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user