Skip to content

Commit

Permalink
slab: document kzfree() zeroing behavior
Browse files Browse the repository at this point in the history
As suggested by Alan Cox, document the fact that kzfree() can zero out a great
deal more memory than the what the user requested from kmalloc().

Cc: Alan Cox <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
Pekka Enberg committed Jun 1, 2009
1 parent 59a3759 commit a234bdc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ EXPORT_SYMBOL(krealloc);
*
* The memory of the object @p points to is zeroed before freed.
* If @p is %NULL, kzfree() does nothing.
*
* Note: this function zeroes the whole allocated buffer which can be a good
* deal bigger than the requested buffer size passed to kmalloc(). So be
* careful when using this function in performance sensitive code.
*/
void kzfree(const void *p)
{
Expand Down

0 comments on commit a234bdc

Please sign in to comment.