.\" -*- nroff -*- .TH kmalloc 9 "Aug 3, 1997" "Linux" "Kernel Functions" .SH NAME kmalloc, kfree \- allocate and free pieces of memory .SH SYNOPSIS .B #include .sp .BI "void * kmalloc (size_t " size ", int " priority ");" .br .BI "void kfree (void * " __ptr ");" .SH DESCRIPTION The .B kmalloc function allocates a piece of memory. .PP The parameter .I size is the number of bytes that will be allocated. The parameter .I priority indicates the importance and type of the memory request. Some possible values are GFP_DMA, GFP_ATOMIC, GFP_BUFFER, and GFP_NFS. .PP The .B kfree function releases a piece of memory that is passed as the .I __ptr parameter. .SH "RETURN VALUE" On success, .B kmalloc returns a pointer to the newly allocated memory. .PP If there is an error, NULL is returned instead. .PP .SH AVAILABILITY Linux 2.0 .SH AUTHOR Kirk Petersen (kirk@speakeasy.org) .SH BUGS