]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Refactor: reorder a few structs to make them more compact
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 11 Mar 2023 15:31:43 +0000 (16:31 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 11 Mar 2023 15:31:43 +0000 (16:31 +0100)
Used pahole to find candidates. Don't have any performance
measurements, but it won't do any harm.

coregrind/m_errormgr.c
coregrind/m_hashtable.c
memcheck/mc_include.h

index 52505ba5b2c9131a4f696d7c7e9f124dee3a1f71..6be637190aae8ce4c8d92dfe82f37e6d7e9e079d 100644 (file)
@@ -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.
index 19c604d3a68a932076e58571f9e27d79e79671cc..586cfcc4f3eb591cbcf19878bf908b10f6370fd6 100644 (file)
@@ -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)
 };
 
index 3c1b1a7cd410aaa92dad60ab94b3db35904d30c1..c30ec48efb3a2f4171786d8813b3782db8418058 100644 (file)
@@ -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;