Trait twizzler_runtime_api::CoreRuntime
source · pub trait CoreRuntime {
// Required methods
fn default_allocator(&self) -> &'static dyn GlobalAlloc;
fn exit(&self, code: i32) -> !;
fn abort(&self) -> !;
fn runtime_entry(
&self,
arg: *const AuxEntry,
std_entry: unsafe extern "C" fn(_: BasicAux) -> BasicReturn
) -> !;
// Provided methods
fn pre_main_hook(&self) { ... }
fn post_main_hook(&self) { ... }
}
Expand description
Definitions of core runtime features.
Required Methods§
sourcefn default_allocator(&self) -> &'static dyn GlobalAlloc
fn default_allocator(&self) -> &'static dyn GlobalAlloc
Returns a reference to an allocator to use for default (global) allocations.
sourcefn exit(&self, code: i32) -> !
fn exit(&self, code: i32) -> !
Exit the calling thread. This is allowed to cause a full exit of the entire program and all threads.
sourcefn abort(&self) -> !
fn abort(&self) -> !
Thread abort. This is allowed to cause a full exit of the entire program and all threads.
sourcefn runtime_entry(
&self,
arg: *const AuxEntry,
std_entry: unsafe extern "C" fn(_: BasicAux) -> BasicReturn
) -> !
fn runtime_entry( &self, arg: *const AuxEntry, std_entry: unsafe extern "C" fn(_: BasicAux) -> BasicReturn ) -> !
Called by rt0 code to start the runtime. Once the runtime has initialized, it should call the provided entry function. The pointer arg is a pointer to an array of AuxEntry that terminates with an AuxEntry::Null.
Provided Methods§
sourcefn pre_main_hook(&self)
fn pre_main_hook(&self)
Called by libstd before calling main.
sourcefn post_main_hook(&self)
fn post_main_hook(&self)
Called by libstd after returning from main.