krealloc_array(9)
π krealloc_array π
okay so bestie, this is the Kernel API Manual page for krealloc_array, and she is literally here to reallocate memory for an array. iconic behavior. β¨
π NAME π
krealloc_arrayβ reallocate memory for an array π
β¨ SYNOPSIS β¨
void * krealloc_array (void *p , size_t new_n , size_t new_size , gfp_t
flags );
π¦ ARGUMENTS π¦
pβ pointer to the memory chunk to reallocate π«Άnew_nβ the new number of elements to alloc π§new_sizeβ the new size of a single member of the array πΈflagsβ the type of memory to allocate (seekmalloc) π₯
π DESCRIPTION π
okay so here's the vibe check on __GFP_ZERO β and ngl, this part matters. π
β οΈ bestie, listen: if__GFP_ZEROlogic is requested, callers must ensure that, starting with the initial memory allocation, every subsequent call to this API for the same memory allocation is flagged with__GFP_ZERO. Otherwise, it is possible that__GFP_ZEROis not fully honored by this API. π
See krealloc_noprof for further details. π«‘
In any case, the contents of the object pointed to are preserved up to the lesser of the new and old sizes. no cap. π
π SEE ALSO π
Kernel file ./include/linux/slab.h β say hi to the whole squad:
SLAB_HWCACHE_ALIGN(9)SLAB_TYPESAFE_BY_RCU(9)SLAB_ACCOUNT(9)SLAB_RECLAIM_ACCOUNT(9)struct kmem_cache_args(9)kmem_cache_create_usercopy(9)kmem_cache_create(9)krealloc_node_align(9)kmem_cache_alloc(9)kmem_cache_charge(9)kmalloc(9)kmalloc_nolock(9)__alloc_objs(9)__alloc_flex(9)kmalloc_obj(9)kmalloc_objs(9)kmalloc_flex(9)kmalloc_array(9)kcalloc(9)kzalloc(9)kvmalloc_node(9)kvrealloc_node_align(9)kmalloc_size_roundup(9)
and that's the tea π β this page comes from ./include/linux, dated October 2026, and it's still your girl krealloc_array(9). mwah πβ¨
π¦ 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