'\" t .\" Title: ksize .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Memory Management in Linux .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "KSIZE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Memory Management in Linux" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ksize \- get the actual amount of memory allocated for a given object .SH "SYNOPSIS" .HP \w'size_t\ ksize('u .BI "size_t ksize(const\ void\ *\ " "objp" ");" .SH "ARGUMENTS" .PP \fIobjp\fR .RS 4 Pointer to the object .RE .SH "DESCRIPTION" .PP kmalloc may internally round up allocations and return more memory than requested\&. \fBksize\fR can be used to determine the actual amount of memory allocated\&. The caller may use this additional memory, even though a smaller amount of memory was initially specified with the kmalloc call\&. The caller must guarantee that objp points to a valid object previously allocated with either \fBkmalloc\fR or \fBkmem_cache_alloc\fR\&. The object must not be freed during the duration of the call\&. .SH "COPYRIGHT" .br