Boot OOM
include/mem/alloc_or_die.h View source View on GitHubMacros
Section titled “Macros”alloc_or_die
Section titled “alloc_or_die”#define alloc_or_die(expr) \
({ \
if (global.current_bootstage >= BOOTSTAGE_COMPLETE) \
log_warn_once("alloc_or_die invoked after boot"); \
__typeof__(expr) _p_ = (expr); \
if (unlikely(!_p_)) \
panic("OOM: %s == NULL, stage: %s", #expr, \
bootstage_str[global.current_bootstage]); \
_p_; \
}) kmalloc_or_die
Section titled “kmalloc_or_die”#define kmalloc_or_die(...) alloc_or_die(kmalloc(__VA_ARGS__))