|
|
Created:
3 years, 11 months ago by brucedawson Modified:
3 years, 11 months ago Reviewers:
stanisc CC:
chromium-reviews, sync-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMove syncer::kModelTypeInfoMap array to read-only data segment
Due to a quirk in VC++ it is easy to accidentally prevent a const global
array from being placed in the read-only data segment. This change
removes some should-be-harmless 'const' keywords to work around this
quirk and move ~960 bytes to the .rdata (read-only) data segment in
chrome.dll.
VC++ bug is filed here:
https://connect.microsoft.com/VisualStudio/feedback/details/3117602
Other instances of this quirk are also being worked around.
BUG=677351
Committed: https://crrev.com/f647c9f14b76450131f88d99c186010d960aeccf
Cr-Commit-Position: refs/heads/master@{#441250}
Patch Set 1 #
Messages
Total messages: 17 (10 generated)
The CQ bit was checked by brucedawson@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 ========== to ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 ==========
brucedawson@chromium.org changed reviewers: + stanisc@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Would it be better to use a #define that get resolved as nothing on Windows and const on other platforms? I think the reason const was used in this struct is to convey that these fields get initialized once and never changed. Without const that is less obvious.
On 2017/01/03 19:57:00, stanisc wrote: > Would it be better to use a #define that get resolved as nothing on Windows and > const on other platforms? > > I think the reason const was used in this struct is to convey that these fields > get initialized once and never changed. Without const that is less obvious. It looks like ModelTypeInfo is only used to declare the one array and that entire array is const, which means the hint doesn't have much value. That is, we could use a #define but is there enough value to justify the ugliness?
Well, either way is fine with me. I agree that this struct is local to this file so it should be easy to see that the data is actually const by construction. lgtm
The CQ bit was checked by brucedawson@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 1, "attempt_start_ts": 1483480532902860, "parent_rev": "cc9fc63c2e88476cc28742640bf0eb24d81064b7", "commit_rev": "33691e168b6060a35dabc80aa4f471e2f1db90dd"}
Message was sent while issue was closed.
Description was changed from ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 ========== to ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 Review-Url: https://codereview.chromium.org/2605393002 ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Description was changed from ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 Review-Url: https://codereview.chromium.org/2605393002 ========== to ========== Move syncer::kModelTypeInfoMap array to read-only data segment Due to a quirk in VC++ it is easy to accidentally prevent a const global array from being placed in the read-only data segment. This change removes some should-be-harmless 'const' keywords to work around this quirk and move ~960 bytes to the .rdata (read-only) data segment in chrome.dll. VC++ bug is filed here: https://connect.microsoft.com/VisualStudio/feedback/details/3117602 Other instances of this quirk are also being worked around. BUG=677351 Committed: https://crrev.com/f647c9f14b76450131f88d99c186010d960aeccf Cr-Commit-Position: refs/heads/master@{#441250} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/f647c9f14b76450131f88d99c186010d960aeccf Cr-Commit-Position: refs/heads/master@{#441250} |