DescriptionReduce the size of Node by 8 bytes on 64bit with gcc/clang compilers
Reduce the size of Node by 8 bytes on 64bit with gcc and clang compilers
(from 72 bytes to 64 bytes) by altering the order of its parent classes. The
TreeShared<Node> parent class now comes last because it contains only 1 member
(in release) which is an int and the first member of Node is a uint32_t. This
way no padding is added by gcc/clang and these two members will use the same
word in memory.
MSVC likely won't get any benefit from this because it makes sure each class
in the hierarchy is memory-aligned (see "Compiler being used" section in [1]).
There should be no size impact for MSVC.
[1] http://www.cprogramming.com/tutorial/size_of_class_object.html
R=esprehn@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175844
Patch Set 1 #
Messages
Total messages: 7 (0 generated)
|