Zero Cost Abstractions: An Addendum

On Reddit, Icarium-Lifestealer asked me how the disassembly looked if I used -C panic=abort instead of extern "C". Curious, I tried and came out with the following assembly, which is again exactly the same as the C example

        push    rbx
        mov     rbx, rdi
        cmp     dword ptr [rdi], 43
        jl      .LBB3_2
        mov     rdi, rbx
        call    example::bar
        mov     dword ptr [rbx], 42
        mov     rdi, rbx
        pop     rbx
        jmp     example::baz

Leave a Reply

Your email address will not be published. Required fields are marked *