__vcalloc(9)
β¨ __vcalloc β¨
okay so bestie, this is a kernel API manual page (that's the 9 section, iykyk) and honestly? it's a little legend. it's the allocator that hands you memory and zeroes it for you, for a virtually contiguous array. no cap, it does both π
π NAME π
__vcalloc β allocate and zero memory for a virtually contiguous array.
like, it's giving "malloc but make it vmalloc and also please clear it for me" πΈ
π¦ SYNOPSIS π¦
void * __vcalloc (size_t n , size_t size , gfp_t flags );
that's the whole vibe. three args, one pointer back. slay β¨
π ARGUMENTS π
nβ number of elements. how many little guys you want in your array π«Άsizeβ element size. how big each little guy is, in bytes.flagsβ the type of memory to allocate (seekmalloc). yes bestie, actually go readkmalloc, it's right there. this is where you say what kind of memory you're in the mood for π
ngl, the args are tiny but they matter.nΓsizeis the whole math of your array andflagsis the personality of the allocation.
π₯ SEE ALSO π₯
so first up, this thing lives in the kernel file ./mm/util.c β that's its home address, remember it π‘
and then, the whole friend group, in exactly this order:
kfree_const(9)__kmemdup_nul(9)kstrdup(9)kstrdup_const(9)kstrndup(9)kmemdup(9)kmemdup_array(9)kvmemdup(9)kmemdup_nul(9)memdup_user(9)vmemdup_user(9)strndup_user(9)memdup_user_nul(9)randomize_page(9)__account_locked_vm(9)account_locked_vm(9)__vmalloc_array(9)vmalloc_array(9)vcalloc(9)folio_mapping(9)folio_copy(9)get_cmdline(9)mem_dump_obj(9)compat_set_desc_from_vma(9)__compat_vma_mmap(9)compat_vma_mmap(9)snapshot_page(9)mmap_action_prepare(9)mmap_action_complete(9)folio_pte_batch(9)page_range_contiguous(9)
that's thirty-one entries, bestie. i counted. go read them all, i believe in you ππ
and that's the whole page! tail end of it says it comes from ./mm and it's dated October 2026 β so mark your calendar, put it in your planner, this doc is a lil time traveler π§β bye bestie, go zero some 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