Function relocate_member_if

Source
pub const unsafe fn relocate_member_if<T>(
    condition: bool,
    this: *mut u8,
    a: isize,
    b: isize,
) -> *mut T
Expand description

Relocates a member based on a condition, using either offset a or b depending on the condition.

ยงSafety

It is safe as long as the following are observed.

  • ptr of added offset never exceeds isize::MAX
  • All memory from this to offset is valid.