Avoid the possibility of future conflict with another address-of-static due to COMDAT folding.
BUG=none Review URL: https://codereview.chromium.org/12529029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190035 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -14,8 +14,10 @@ namespace components {
|
||||
namespace {
|
||||
|
||||
void* UserDataKey() {
|
||||
// We just need a unique constant. Use the address of this static member.
|
||||
return reinterpret_cast<void*>(&UserPrefs::Get);
|
||||
// We just need a unique constant. Use the address of a static that
|
||||
// COMDAT folding won't touch in an optimizing linker.
|
||||
static int data_key = 0;
|
||||
return reinterpret_cast<void*>(&data_key);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user