DescriptionMove const double data out of header file
When non-integral const data is defined in a header file it often ends
up being instantiated in multiple translation units. It also ends up in
the read/write data segment which means it isn't shared between
processes. This change has the following affect on the size of sections
in a 32-bit release Windows build:
chrome.dll
.text: -432 bytes change
.rdata: 176 bytes change
.data: -128 bytes change
.reloc: 228 bytes change
Total change: -156 bytes
Note that the sections that increase in size are either shareable
(.rdata) or discardable (.reloc).
I wish I could use "extern constexpr" to ensure that no constructors are
run, but C++ does not allow that. inline constexpr is not yet supported,
and making the variables a static constexpr member of a class seems like
overkill.
BUG=630755
Patch Set 1 #
Total comments: 4
Patch Set 2 : Remove duplicate comments #
Messages
Total messages: 12 (10 generated)
|