Macro kernel::static_init[][src]

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

Allocates a statically-sized global array of memory and initializes the memory for a particular data structure.

This macro creates the static buffer, ensures it is initialized to the proper type, and then returns 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.