Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move 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: 144 bytes change .rdata: -32 bytes change .data: -736 bytes change .reloc: 140 bytes change Total change: -484 bytes chrome_child.dll .text: 32 bytes change .rdata: -112 bytes change .data: -736 bytes change .reloc: -84 bytes change Total change: -900 bytes Note that the sections that increase in size are either shareable (.text) 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 (see crrev.com/2512753002) seems like overkill and doesn't seem to help. BUG=630755 Review-Url: https://codereview.chromium.org/2515483002 Cr-Commit-Position: refs/heads/master@{#433727}
- Loading branch information