hex.ptr_flip_dbit¶
The stl.comp_flip_if executes in ~##w, which should be much less than @/2 operations.
Effectively: (*ptr)+dbit;
Flip the address dbit-ahead of what the pointer points to.
ptr is a hex[:w/4] that holds an address, which we assume is dw-aligned.
Signature¶
def ptr_flip_dbit ptr < .pointers.to_flip { ... }
Defined in hex/pointers/xor_to_pointer.fj — lines 25–29 (view on GitHub).
Complexity¶
Time:
w(0.5@+2) + @+6Space:
w(0.5@+14) + @+6
See the complexity glossary for what @, w, dw, dbit, n mean.
Source¶
Click to view the macro body
def ptr_flip_dbit ptr < .pointers.to_flip {
wflip .pointers.to_flip, dbit
.ptr_flip ptr
wflip .pointers.to_flip, dbit
}
Depends on¶
← Previous: hex.ptr_flip
Next: hex.xor_hex_to_ptr/2 →