__memblock_alloc_or_panic(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

__memblock_alloc_or_panic β€” Try to allocate memory and panic on failure.

okay so this is the __memblock_alloc_or_panic(9) page from the Kernel API Manual ✨ and the name is literally giving the whole plot: it tries to allocate memory, and if that fails, it panics πŸ˜­πŸ’….


✨ SYNOPSIS ✨

void * __memblock_alloc_or_panic (phys_addr_t size , phys_addr_t align ,
       const char *func );

πŸŽ€ ARGUMENTS πŸŽ€

  • size β€” size of memory block to be allocated in bytes. literally how many bytes you're asking for, bestie πŸ“
  • align β€” alignment of the region and block's size. this is the alignment of the region and block's size, periodt ✨
  • func β€” caller func name. the caller func name, for the record 🫢

πŸ’– DESCRIPTION πŸ’–

This function attempts to allocate memory using memblock_alloc, and in case of failure, it calls panic with the formatted message. So yeah: it tries, and if it fails, it does not ghost you β€” it calls panic with the formatted message πŸ’€πŸ”₯.

This function should not be used directly, please use the macro memblock_alloc_or_panic. That's the important bit: do not call this one directly, use the macro memblock_alloc_or_panic instead, iykyk πŸ™ˆ.

πŸ¦‹ SEE ALSO πŸ¦‹

the whole crew starts with Kernel file ./mm/memblock.c memblock overview(9), then:


and that's the whole page, bestie πŸ’– source/version ./mm, date October 2026, and yes, __memblock_alloc_or_panic(9) is iconic. periodt πŸŽ€

πŸ“¦ where this page comes from