Commit bb1a03c
committed
Auto merge of rust-lang#95224 - mjbshaw:patch-1, r=yaahc
Optimize RcInnerPtr::inc_strong()/inc_weak() instruction count
Inspired by this internals thread: https://internals.rust-lang.org/t/rc-optimization-on-64-bit-targets/16362
[The generated assembly is a bit smaller](https://rust.godbolt.org/z/TeTnf6144) and is a more efficient usage of the CPU's instruction cache. `unlikely` doesn't impact any of the small artificial tests I've done, but I've included it in case it might help more complex scenarios when this is inlined.1 file changed
+28
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2511 | 2511 | | |
2512 | 2512 | | |
2513 | 2513 | | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
2514 | 2525 | | |
2515 | | - | |
2516 | | - | |
2517 | | - | |
2518 | | - | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
2519 | 2529 | | |
2520 | 2530 | | |
2521 | | - | |
2522 | 2531 | | |
2523 | 2532 | | |
2524 | 2533 | | |
| |||
2535 | 2544 | | |
2536 | 2545 | | |
2537 | 2546 | | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2538 | 2558 | | |
2539 | | - | |
2540 | | - | |
2541 | | - | |
2542 | | - | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
2543 | 2562 | | |
2544 | 2563 | | |
2545 | | - | |
2546 | 2564 | | |
2547 | 2565 | | |
2548 | 2566 | | |
| |||
0 commit comments