From 992f2d15e296d0a746f5161ebf3d4511ead9d99d Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 14 Aug 2002 09:13:10 +0000 Subject: (__malloc_likely, __malloc_unlikely): New macros. --- libc/stdlib/malloc/malloc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libc/stdlib') diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h index cc2bf35ba..6c4590894 100644 --- a/libc/stdlib/malloc/malloc.h +++ b/libc/stdlib/malloc/malloc.h @@ -109,6 +109,16 @@ extern malloc_mutex_t __malloc_sbrk_lock; #endif /* __UCLIBC_HAS_THREADS__ */ +/* Use branch-prediction macros from libc if defined. */ +#ifdef likely +#define __malloc_likely(c) likely(c) +#define __malloc_unlikely(c) unlikely(c) +#else +#define __malloc_likely(c) (c) +#define __malloc_unlikely(c) (c) +#endif + + /* Define MALLOC_DEBUGGING to cause malloc to emit debugging info to stderr. */ #ifdef MALLOC_DEBUGGING #include -- cgit v1.2.3