From 6b2de1c8b51e9bf3e9f66e8df94aebaf843cbbee Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 15 May 2021 12:56:52 +0200 Subject: [PATCH] Pack PID + TID. --- import-chrome/src/import-chrome.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/import-chrome/src/import-chrome.cpp b/import-chrome/src/import-chrome.cpp index 2811a945..8a5df664 100644 --- a/import-chrome/src/import-chrome.cpp +++ b/import-chrome/src/import-chrome.cpp @@ -162,7 +162,10 @@ int main( int argc, char** argv ) if( pair.pid == pid && pair.tid == real_tid ) return pair.pseudo_tid; } - const auto pseudo_tid = tid_encoders.size(); + assert( pid <= std::numeric_limits::max() ); + assert( real_tid <= std::numeric_limits::max() ); + + const auto pseudo_tid = ( real_tid & 0xFFFFFFFF ) | ( pid << 32 ); tid_encoders.emplace_back(PidTidEncoder {real_tid, pid, pseudo_tid}); return pseudo_tid; }