summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc')
-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>