[][src]Macro kernel::static_init

macro_rules! static_init {
    ($T:ty, $e:expr) => { ... };

Allocates a global array of static size to initialize data structures.

The global array is initially set to zero. When this macro is hit, it will initialize the array to the value given and return a &'static mut reference to it.


As this macro will write directly to a global area without acquiring a lock or similar, calling this macro is inherently unsafe. The caller should take care to never call the code that initializes this buffer twice, as doing so will overwrite the value from first allocation without running its destructor.