Reorder members of Material::Entry
authormstembera <MissingEmail@email>
Fri, 24 Feb 2017 05:33:03 +0000 (21:33 -0800)
committerJoona Kiiski <joona@zoox.com>
Fri, 24 Feb 2017 05:33:03 +0000 (21:33 -0800)
This eliminates alignment padding and reduces size from 48 to 40 bytes.
This makes the material HashTable smaller and more cache friendly.

No functional change

Closes #1013

src/material.h

index 9d6eed0a4419d1516f6cb490f4865288159564e7..ccf97b71d6970fd0913797fe89cff1d5b5249cc1 100644 (file)
@@ -56,11 +56,11 @@ struct Entry {
   }
 
   Key key;
   }
 
   Key key;
-  int16_t value;
-  uint8_t factor[COLOR_NB];
   EndgameBase<Value>* evaluationFunction;
   EndgameBase<ScaleFactor>* scalingFunction[COLOR_NB]; // Could be one for each
                                                        // side (e.g. KPKP, KBPsKs)
   EndgameBase<Value>* evaluationFunction;
   EndgameBase<ScaleFactor>* scalingFunction[COLOR_NB]; // Could be one for each
                                                        // side (e.g. KPKP, KBPsKs)
+  int16_t value;
+  uint8_t factor[COLOR_NB];
   Phase gamePhase;
 };
 
   Phase gamePhase;
 };