From: Paul Floyd Date: Sat, 11 Mar 2023 15:31:43 +0000 (+0100) Subject: Refactor: reorder a few structs to make them more compact X-Git-Tag: VALGRIND_3_21_0~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=036bf06734321b352e1069b561a4730e5daff52f;p=thirdparty%2Fvalgrind.git Refactor: reorder a few structs to make them more compact Used pahole to find candidates. Don't have any performance measurements, but it won't do any harm. --- diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c index 52505ba5b2..6be637190a 100644 --- a/coregrind/m_errormgr.c +++ b/coregrind/m_errormgr.c @@ -130,9 +130,9 @@ struct _Error { // which it can be referred to afterwords. Currently only used for // XML printing. UInt unique; + Int count; // NULL if unsuppressed; or ptr to suppression record. Supp* supp; - Int count; // The tool-specific part ThreadId tid; // Initialised by core @@ -225,8 +225,8 @@ typedef (0..)) for 'skind'. */ struct _Supp { struct _Supp* next; - Int count; // The number of times this error has been suppressed. HChar* sname; // The name by which the suppression is referred to. + Int count; // The number of times this error has been suppressed. // Index in VG_(clo_suppressions) giving filename from which suppression // was read, and the lineno in this file where sname was read. diff --git a/coregrind/m_hashtable.c b/coregrind/m_hashtable.c index 19c604d3a6..586cfcc4f3 100644 --- a/coregrind/m_hashtable.c +++ b/coregrind/m_hashtable.c @@ -45,8 +45,8 @@ struct _VgHashTable { UInt n_elements; VgHashNode* iterNode; // current iterator node UInt iterChain; // next chain to be traversed by the iterator - VgHashNode** chains; // expanding array of hash chains Bool iterOK; // table safe to iterate over? + VgHashNode** chains; // expanding array of hash chains const HChar* name; // name of table (for debugging only) }; diff --git a/memcheck/mc_include.h b/memcheck/mc_include.h index 3c1b1a7cd4..c30ec48efb 100644 --- a/memcheck/mc_include.h +++ b/memcheck/mc_include.h @@ -455,9 +455,9 @@ typedef SizeT szB; // Sum of all MC_Chunk.szB values. SizeT indirect_szB; // Sum of all LC_Extra.indirect_szB values. UInt num_blocks; // Number of blocks represented by the record. + UInt old_num_blocks; // output only the changed/new loss records SizeT old_szB; // old_* values are the values found during the SizeT old_indirect_szB; // previous leak search. old_* values are used to - UInt old_num_blocks; // output only the changed/new loss records } LossRecord;