Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys Add an additional usage note about using __predict_*...
details: https://anonhg.NetBSD.org/src/rev/a226ea1a14fe
branches: trunk
changeset: 485927:a226ea1a14fe
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon May 08 22:41:38 2000 +0000
description:
Add an additional usage note about using __predict_*() only in hot spots,
as suggested by Chris Demetriou.
diffstat:
sys/sys/cdefs.h | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diffs (22 lines):
diff -r 1acbc84e0387 -r a226ea1a14fe sys/sys/cdefs.h
--- a/sys/sys/cdefs.h Mon May 08 21:58:40 2000 +0000
+++ b/sys/sys/cdefs.h Mon May 08 22:41:38 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.33 2000/05/08 18:36:00 thorpej Exp $ */
+/* $NetBSD: cdefs.h,v 1.34 2000/05/08 22:41:38 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -215,6 +215,12 @@
* * Other than that, if you don't know the liklyhood of a test
* succeeding from empirical or other `hard' evidence, don't
* make predictions.
+ *
+ * * These are meant to be used in places that are run `a lot'.
+ * It is wasteful to make predictions in code that is run
+ * seldomly (e.g. at subsystem initialization time) as the
+ * basic block reordering that this affects can often generate
+ * larger code.
*/
#if __GNUC_PREREQ__(2, 96)
#define __predict_true(exp) __builtin_expect(((exp) != 0), 1)
Home |
Main Index |
Thread Index |
Old Index