DescriptionMove ~200 Feature objects to read-only memory in Windows builds
A VC++ bug was preventing base::Feature objects from going into the
read-only section despite being tagged as const. Adding a constexpr
constructor solves this problem. Some of the variables (kTimerThrottlingForHiddenFrames for instance) get optimized away
entirely which is why the size changes are not symmetrical.
The VC++ bug is:
https://connect.microsoft.com/VisualStudio/feedback/details/3117602
Previous instances of this bug were worked around by deleting const
but this seemed undesirable in this case. Luckily the constexpr fix
seems to work just as well.
Approximate deltas are:
chrome.dll
.text: -48 bytes change
.rdata: 1216 bytes change
.data: -1376 bytes change
.reloc: -32 bytes change
Total change: -240 bytes
chrome_child.dll
.text: -16 bytes change
.rdata: 704 bytes change
.data: -800 bytes change
.reloc: 32 bytes change
Total change: -80 bytes
Modest, but it's good to move a few hundred variables to read-only
memory.
This should not affect other platforms.
BUG=677351
Review-Url: https://codereview.chromium.org/2623373004
Cr-Commit-Position: refs/heads/master@{#443616}
Committed: https://chromium.googlesource.com/chromium/src/+/cbbcb90c9c4388226eadba1632bc85040e66c8cc
Patch Set 1 #
Messages
Total messages: 14 (10 generated)
|