bit.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 bit[:w] that holds an address, which we assume is dw-aligned.

Signature

def ptr_flip_dbit ptr { ... }

Defined in bit/pointers.fj — lines 88–92 (view on GitHub).

Complexity

  • Time: 2w@ + 2@

  • Space: 2w@ + 2@

See the complexity glossary for what @, w, dw, dbit, n mean.

Requires init

The following must be initialised before this macro is invoked:

  • bit.pointers.ptr_init

Source

Depends on

Used by

Example uses


← Previous: bit.ptr_flip Next: bit.xor_to_ptr