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§

source

fn default_allocator(&self) -> &'static dyn GlobalAlloc

Returns a reference to an allocator to use for default (global) allocations.

source

fn exit(&self, code: i32) -> !

Exit the calling thread. This is allowed to cause a full exit of the entire program and all threads.

source

fn abort(&self) -> !

Thread abort. This is allowed to cause a full exit of the entire program and all threads.

source

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§

source

fn pre_main_hook(&self)

Called by libstd before calling main.

source

fn post_main_hook(&self)

Called by libstd after returning from main.

Implementors§