| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) | 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 { | 312 { |
| 313 *ptr = value; | 313 *ptr = value; |
| 314 } | 314 } |
| 315 | 315 |
| 316 ALWAYS_INLINE float noBarrierLoad(volatile const float* ptr) | 316 ALWAYS_INLINE float noBarrierLoad(volatile const float* ptr) |
| 317 { | 317 { |
| 318 float value = *ptr; | 318 float value = *ptr; |
| 319 return value; | 319 return value; |
| 320 } | 320 } |
| 321 | 321 |
| 322 ALWAYS_INLINE void noBarrierStore(volatile int* ptr, int value) | |
| 323 { | |
| 324 *ptr = value; | |
| 325 } | |
| 326 | |
| 327 ALWAYS_INLINE int noBarrierLoad(volatile const int* ptr) | |
| 328 { | |
| 329 int value = *ptr; | |
| 330 return value; | |
| 331 } | |
| 332 | |
| 333 #if defined(ADDRESS_SANITIZER) | 322 #if defined(ADDRESS_SANITIZER) |
| 334 | 323 |
| 335 NO_SANITIZE_ADDRESS ALWAYS_INLINE void asanUnsafeReleaseStore(volatile unsigned*
ptr, unsigned value) | 324 NO_SANITIZE_ADDRESS ALWAYS_INLINE void asanUnsafeReleaseStore(volatile unsigned*
ptr, unsigned value) |
| 336 { | 325 { |
| 337 MEMORY_BARRIER(); | 326 MEMORY_BARRIER(); |
| 338 *ptr = value; | 327 *ptr = value; |
| 339 } | 328 } |
| 340 | 329 |
| 341 NO_SANITIZE_ADDRESS ALWAYS_INLINE unsigned asanUnsafeAcquireLoad(volatile const
unsigned* ptr) | 330 NO_SANITIZE_ADDRESS ALWAYS_INLINE unsigned asanUnsafeAcquireLoad(volatile const
unsigned* ptr) |
| 342 { | 331 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 using WTF::noBarrierLoad; | 367 using WTF::noBarrierLoad; |
| 379 using WTF::noBarrierStore; | 368 using WTF::noBarrierStore; |
| 380 | 369 |
| 381 // These methods allow loading from and storing to poisoned memory. Only | 370 // These methods allow loading from and storing to poisoned memory. Only |
| 382 // use these methods if you know what you are doing since they will | 371 // use these methods if you know what you are doing since they will |
| 383 // silence use-after-poison errors from ASan. | 372 // silence use-after-poison errors from ASan. |
| 384 using WTF::asanUnsafeAcquireLoad; | 373 using WTF::asanUnsafeAcquireLoad; |
| 385 using WTF::asanUnsafeReleaseStore; | 374 using WTF::asanUnsafeReleaseStore; |
| 386 | 375 |
| 387 #endif // Atomics_h | 376 #endif // Atomics_h |
| OLD | NEW |