DescriptionMove const PortName 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: -128 bytes change
.rdata: 64 bytes change
.data: -800 bytes change
.reloc: -12 bytes change
Total change: -876 bytes
chrome_child.dll
.text: 64 bytes change
.rdata: 48 bytes change
.data: -800 bytes change
.reloc: -68 bytes change
Total change: -756 bytes
Note that the sections that increase in size are shareable.
The technique of using static constexpr in a struct is the only way to
guarantee both zero duplication of data and no run-time construction
of data (until C++17 and inline variables).
BUG=630755
Patch Set 1 #
Messages
Total messages: 5 (4 generated)
|