Index: third_party/tcmalloc/chromium/src/maybe_threads.cc |
diff --git a/third_party/tcmalloc/chromium/src/maybe_threads.cc b/third_party/tcmalloc/chromium/src/maybe_threads.cc |
index 15c8a23dcb3509549ef6b45531f2418e988a3cf5..d7e5ce0573817a109307831464fd0e8505a46c70 100644 |
--- a/third_party/tcmalloc/chromium/src/maybe_threads.cc |
+++ b/third_party/tcmalloc/chromium/src/maybe_threads.cc |
@@ -1,10 +1,10 @@ |
// Copyright (c) 2005, Google Inc. |
// All rights reserved. |
-// |
+// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
-// |
+// |
// * Redistributions of source code must retain the above copyright |
// notice, this list of conditions and the following disclaimer. |
// * Redistributions in binary form must reproduce the above |
@@ -14,7 +14,7 @@ |
// * Neither the name of Google Inc. nor the names of its |
// contributors may be used to endorse or promote products derived from |
// this software without specific prior written permission. |
-// |
+// |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -124,7 +124,9 @@ int perftools_pthread_once(pthread_once_t *ctl, |
if (pthread_once) { |
return pthread_once(ctl, init_routine); |
} else { |
- if (memcmp(ctl, &pthread_once_init, sizeof(*ctl)) == 0) { |
+ if (memcmp((const void*)(ctl), |
+ (const void*)(&pthread_once_init), |
+ sizeof(*ctl)) == 0) { |
init_routine(); |
++*(char*)(ctl); // make it so it's no longer equal to init |
} |