vzalloc(9)
β¨ vzalloc(9) β¨
okay so bestie, welcome to the Kernel API Manual page for vzalloc β this is the one that hands you a big block of memory that's all zeros already, so you don't have to do the whole "memset it yourself" ritual π
πΈ SYNOPSIS πΈ
void * vzalloc (unsigned long size );
π ARGUMENTS π
sizeβ the allocation size. like, how much you want. that's it, that's the whole argument, she's not complicated π
π¦ DESCRIPTION π¦
So what she does: she allocates enough pages to cover size from the page level allocator, and then she maps them into contiguous kernel virtual space. yes, contiguous in virtual space β that's literally the whole sell, iykyk β¨
And the memory she gives you back is set to zero. free zeroing, no cap. you don't have to clean it up, she already did π«Ά
but like β if you want tight control over the page level allocator and the protection flags, use__vmallocinstead.vzallocis the girl who picks the defaults for you;__vmallocis you doing it yourself with full customisation energy π
β RETURN β
- a pointer to the allocated memory β slay π
- or
NULLon error β sad girl hours π
π SEE ALSO π
Kernel file ./mm/vmalloc.c β plus literally the entire friend group:
vunmap_range(9)vmap_pages_range(9)vm_area_map_pages(9)vm_area_unmap_pages(9)new_vmap_block(9)vm_unmap_aliases(9)vm_unmap_ram(9)vm_map_ram(9)vm_area_add_early(9)vm_area_register_early(9)get_vm_area(9)find_vm_area(9)remove_vm_area(9)vfree_atomic(9)vfree(9)vunmap(9)vmap(9)vmap_pfn(9)__vmalloc_node_range(9)__vmalloc_node(9)vmalloc(9)vmalloc_huge_node(9)vmalloc_user(9)vmalloc_node(9)vzalloc_node(9)vrealloc_node_align(9)vmalloc_32(9)vmalloc_32_user(9)vread_iter(9)remap_vmalloc_range_partial(9)remap_vmalloc_range(9)pvm_find_va_enclose_addr(9)pvm_determine_end_from_reverse(9)pcpu_get_vm_areas(9)pcpu_free_vm_areas(9)
and that's the page, bestie π this drop came from the ./mm girlies, October 2026 edition, and honestly? iconic of them. go forth and allocate zeroed virtually-contiguous memory responsibly πΈππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms