Function relocate_member_if_newer_mut

Source
pub unsafe fn relocate_member_if_newer_mut<THIS, T>(
    version: Version,
    this: &mut THIS,
    older: isize,
    newer: isize,
) -> Result<&mut T, RelocationError>
Expand description

Relocates a member based on the version comparison, using either older or newer offset depending on the current version.

§Safety

It is safe as long as the following are observed.

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

§Errors

This function may return an error if the module’s state cannot be accessed, or if the map_active call fails when fetching the current version.