Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix for heap vulnerability
- Loading branch information
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //======================================================================== | ||
| // | ||
| // GooLikely.h | ||
| // | ||
| // This file is licensed under the GPLv2 or later | ||
| // | ||
| // Copyright (C) 2008 Kees Cook <kees@outflux.net> | ||
| // | ||
| //======================================================================== | ||
|
|
||
| #ifndef GOOLIKELY_H | ||
| #define GOOLIKELY_H | ||
|
|
||
| #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) | ||
| # define likely(x) __builtin_expect((x), 1) | ||
| # define unlikely(x) __builtin_expect((x), 0) | ||
| #else | ||
| # define likely(x) (x) | ||
| # define unlikely(x) (x) | ||
| #endif | ||
|
|
||
| #endif |