get_global

Function get_global 

Source
pub fn get_global<T>(p: u64) -> &'static T
Expand description

Returns a static reference to a value at the given memory address.

§Safety

This is highly unsafe as it dereferences a raw pointer without any checks. The caller must ensure:

  • The pointer is valid and properly aligned
  • The memory contains a properly initialized value of type T
  • The referenced data will remain valid for the ’static lifetime
  • No mutable references exist to the same memory
  • No data races can occur when accessing the reference