1KSIZE(9) Memory Management in Linux KSIZE(9)
2
3
4
6 ksize - get the actual amount of memory allocated for a given object
7
9 size_t ksize(const void * objp);
10
12 objp
13 Pointer to the object
14
16 kmalloc may internally round up allocations and return more memory than
17 requested. ksize can be used to determine the actual amount of memory
18 allocated. The caller may use this additional memory, even though a
19 smaller amount of memory was initially specified with the kmalloc call.
20 The caller must guarantee that objp points to a valid object previously
21 allocated with either kmalloc or kmem_cache_alloc. The object must not
22 be freed during the duration of the call.
23
25Kernel Hackers Manual 2.6. June 2019 KSIZE(9)