Crate globalvar

Source

Functionsยง

def_global_ptr
Creates a heap-allocated global pointer to the given value and returns its raw address. The pointer will not be automatically deallocated (leaked intentionally).
drop_global_var
Removes and drops a global variable of type T stored with the given key.
fetch_global_var
Retrieves a reference to a global variable of type T stored with the given key.
fetch_global_var_mut
Retrieves a mutable reference to a global variable of type T by its key.
get_global
Returns a static reference to a value at the given memory address.
get_global_mut
Returns a mutable reference to a global variable of type T from the given pointer.
init_global_var
Initializes a global variable with the given key and value.
undef_global_ptr
Converts a raw pointer to a Box<T> and immediately drops it, effectively deallocating the memory. This is unsafe as it assumes the pointer is valid and properly aligned. Use with caution to avoid undefined behavior.