lkml.org 
[lkml]   [2006]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] include/linux/slab.h: new KFREE() macro.
Date
> +#define KFREE(x)		\
> + do { \
> + kfree(x); \
> + x = NULL; \
> + } while(0)

This doesn't work correctly if "x" has side effects --
double evaluation. Use a temporary variable instead,
or better, an inline function. A better name wouldn't
hurt either (kfree_and_zero()?)


Segher

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-01-01 04:03    [W:0.064 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site