Commit 3f7f5e8
authored
Optimize RcInnerPtr::inc_strong 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 parent a4a5e79 commit 3f7f5e8
1 file changed
+24
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2512 | 2512 | | |
2513 | 2513 | | |
2514 | 2514 | | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
2515 | 2524 | | |
2516 | | - | |
2517 | | - | |
2518 | | - | |
2519 | | - | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
2520 | 2528 | | |
2521 | 2529 | | |
2522 | | - | |
2523 | 2530 | | |
2524 | 2531 | | |
2525 | 2532 | | |
| |||
2536 | 2543 | | |
2537 | 2544 | | |
2538 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
2539 | 2555 | | |
2540 | | - | |
2541 | | - | |
2542 | | - | |
2543 | | - | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
2544 | 2559 | | |
2545 | 2560 | | |
2546 | | - | |
2547 | 2561 | | |
2548 | 2562 | | |
2549 | 2563 | | |
| |||
0 commit comments