summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/malloc.h
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2002-08-14 09:13:10 +0000
committerMiles Bader <miles@lsi.nec.co.jp>2002-08-14 09:13:10 +0000
commit992f2d15e296d0a746f5161ebf3d4511ead9d99d (patch)
treeed6ebf3a6e7e99425098bd65f9f27d6aa5ee4c44 /libc/stdlib/malloc/malloc.h
parentcb6fdcff807a2d2c22cb3a5be03118d5d3695e10 (diff)
(__malloc_likely, __malloc_unlikely): New macros.
Diffstat (limited to 'libc/stdlib/malloc/malloc.h')
-rw-r--r--libc/stdlib/malloc/malloc.h10
1 files changed, 10 insertions, 0 deletions
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 <stdio.h>