Add an additional usage note about using __predict_*() only in hot spots,

as suggested by Chris Demetriou.
This commit is contained in:
thorpej 2000-05-08 22:41:38 +00:00
parent 7ae9f5b5e9
commit 9e79857b5c
1 changed files with 7 additions and 1 deletions

View File

@ -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 * Copyright (c) 1991, 1993
@ -215,6 +215,12 @@
* * Other than that, if you don't know the liklyhood of a test * * Other than that, if you don't know the liklyhood of a test
* succeeding from empirical or other `hard' evidence, don't * succeeding from empirical or other `hard' evidence, don't
* make predictions. * 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) #if __GNUC_PREREQ__(2, 96)
#define __predict_true(exp) __builtin_expect(((exp) != 0), 1) #define __predict_true(exp) __builtin_expect(((exp) != 0), 1)