DescriptionMake the placement-new buffer in LazyInstance<Type> aligned.
Before, the LazyInstance::buf_ was 4-byte aligned on x64, which is wrong.
WHY?! I thought buf_ is the first member of LazyInstance?!
NO! LazyInstance inherits LazyInstanceHelper, sizeof(LIH) = 4.
Then, buf_ is given to placement new.
As a result, the LazyInstance<Type> instances are all 4-byte aligned on x64.
This may break some stuff like SSE-based optimizations assuming the instance is
8-bytes aligned (fair assumption).
Also, if Type contains a bunch of std::vector/hash_map's, their pointers occupy
two half-words and Valgrind doesn't traverse to their data, reporting a false leak.
BUG=64930
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=106763
Patch Set 1 #Patch Set 2 : '' #
Total comments: 1
Patch Set 3 : '' #
Total comments: 4
Patch Set 4 : '' #
Messages
Total messages: 9 (0 generated)
|