Commit b716501
committed
mimalloc: fix mi_atomic_yield on 32-bit ARM
Previously, `mi_atomic_yield` for 32-bit ARM:
* Used a non-standard __ARM_ARCH__ macro to determine if the compiler
was targeting ARMv7+ in order to emit a `yield` instruction, however
it was often not defined so fell through to an `__armel__` branch
* Had a logic gap in the #ifdef where an `__arm__` target would be
expected to emit `mi_atomic_yield` but there was no condition to
define a function for big-endian targets
Now, the standard ACLE __ARM_ARCH macro [1] [2] is used which GCC and
Clang support.
The branching logic for `__armel__` has been removed so if the target
architecture supports v7+ instructions, a `yield` is emitted, otherwise
a `nop` is emitted. This covers both big and little endian scenarios.
[1]: https://arm-software.github.io/acle/main/acle.html#arm-architecture-level
[2]: https://arm-software.github.io/acle/main/acle.html#mapping-of-object-build-attributes-to-predefines
Signed-off-by: Vincent Fazio <[email protected]>1 parent 151d1bf commit b716501
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
| 352 | + | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
| |||
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
0 commit comments