Yeah, a lot of newbies think that :)
> For one thing, the latter is hell on any search.
If the usage of the type is hard to search for then
then wrong identifier was chosen.
> Moreover, I would
> argue that memset() on a structure is not a good idea - better do
> the explicit initialization.
memset will run at up to twice the speed (according to
Arjan). Dunno if this includes I-cache misses - probably
not.
I'm not particularly fussed about this one, but I do prefer
the sleep-at-night safety of a blanket memset. Because
(and I think this is something on which you and I somewhat
differ) code should be written for the convenience of others,
not the original author. A nice memset will leave no doubt
in the reader's mind that all members of the structure have
been initialised.
BTW, Linus: while we're on the topic, I think we should do
this again:
--- linux-2.5.7/mm/slab.c Sat Mar 9 00:18:43 2002
+++ 25/mm/slab.c Thu Mar 28 09:42:41 2002
@@ -95,9 +95,9 @@
#define STATS 1
#define FORCED_DEBUG 1
#else
-#define DEBUG 0
-#define STATS 0
-#define FORCED_DEBUG 0
+#define DEBUG 1 /* It's a development kernel */
+#define STATS 1
+#define FORCED_DEBUG 1
#endif
/*
-
-
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/