Changeset 55951 in vbox for trunk/include/iprt/cdefs.h
- Timestamp:
- May 19, 2015 11:48:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r55468 r55951 1321 1321 * A few notes about the usage: 1322 1322 * 1323 * - Generally, order your code use RT_LIKELY() instead of RT_UNLIKELY(). 1324 * 1323 1325 * - Generally, use RT_UNLIKELY() with error condition checks (unless you 1324 1326 * have some _strong_ reason to do otherwise, in which case document it), … … 1328 1330 * - Other than that, if you don't know the likelihood of a test succeeding 1329 1331 * from empirical or other 'hard' evidence, don't make predictions unless 1330 * you happen to be a Dirk Gently .1332 * you happen to be a Dirk Gently character. 1331 1333 * 1332 1334 * - These macros are meant to be used in places that get executed a lot. It … … 1336 1338 * 1337 1339 * - Note that RT_SUCCESS() and RT_FAILURE() already makes use of RT_LIKELY() 1338 * and RT_UNLIKELY(). Should you wish for prediction free status checks,1340 * and RT_UNLIKELY(). Should you wish for prediction free status checks, 1339 1341 * use the RT_SUCCESS_NP() and RT_FAILURE_NP() macros instead. 1340 1342 * … … 1342 1344 * @returns the boolean result of the expression. 1343 1345 * @param expr The expression that's very likely to be true. 1344 * @see RT_UNLIKELY1346 * @see RT_UNLIKELY 1345 1347 */ 1346 1348 /** @def RT_UNLIKELY … … 1351 1353 * @returns the boolean result of the expression. 1352 1354 * @param expr The expression that's very unlikely to be true. 1353 * @see RT_LIKELY 1355 * @see RT_LIKELY 1356 * 1357 * @remarks Please use RT_LIKELY() instead wherever possible! That gives us a 1358 * better chance of the windows compilers to generate favorable code 1359 * too. The belief is that the compiler will by default assume the 1360 * if-case is more likely than the else-case. 1354 1361 */ 1355 1362 #if defined(__GNUC__)
Note:
See TracChangeset
for help on using the changeset viewer.