protection_domain

Attribute Macro protection_domain 

#[protection_domain]
Expand description

Declares a function to be the the protection domain’s initialization function.

For example:

#[protection_domain]
fn init() -> impl Handler {
    todo!()
}

The initialization function have a signature of the form:

fn<T: Handler>() -> T

(See Handler)

This macro an optional heap_size parameter, whose value can be any expression of type usize:

#[protection_domain(heap_size = <heap_size_expr: usize>)]

If this parameter is provided, the macro creates a #[global_allocator], backed by a static heap of the specified size. If this parameter is not specified, no #[global_allocator] will be automatically declared, and, unless one is manually declared, heap allocations will result in a link-time error.