Move LIKELY/UNLIKELY into header
This commit is contained in:
parent
43a201662a
commit
43fb105ff1
Notes:
blender-bot
2023-02-14 10:50:46 +01:00
Referenced by issue #39626, Matcaps contaminated by Active Object color in Edit mode Referenced by issue #39627, HSL color sliders acting funky
|
@ -15,11 +15,6 @@
|
|||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Brecht Van Lommel
|
||||
* Campbell Barton
|
||||
*
|
||||
|
|
|
@ -221,14 +221,6 @@ static bool malloc_debug_memset = false;
|
|||
/* implementation */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
# define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
# define LIKELY(x) (x)
|
||||
# define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((format(printf, 1, 2)))
|
||||
#endif
|
||||
|
|
|
@ -77,6 +77,14 @@
|
|||
|
||||
#define SIZET_ALIGN_4(len) ((len + 3) & ~(size_t)3)
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
# define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
# define LIKELY(x) (x)
|
||||
# define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
/* Prototypes for counted allocator functions */
|
||||
size_t MEM_lockfree_allocN_len(const void *vmemh) ATTR_WARN_UNUSED_RESULT;
|
||||
void MEM_lockfree_freeN(void *vmemh);
|
||||
|
|
|
@ -15,11 +15,6 @@
|
|||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): Brecht Van Lommel
|
||||
* Campbell Barton
|
||||
* Sergey Sharybin
|
||||
|
@ -63,14 +58,6 @@ static void (*thread_unlock_callback)(void) = NULL;
|
|||
#define PTR_FROM_MEMHEAD(memhead) (memhead + 1)
|
||||
#define MEMHEAD_IS_MMAP(memhead) ((memhead)->len & (size_t) 1)
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
# define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
#else
|
||||
# define LIKELY(x) (x)
|
||||
# define UNLIKELY(x) (x)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__ ((format(printf, 1, 2)))
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue